aboutsummaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/device.c32
-rw-r--r--drivers/core/lists.c8
-rw-r--r--drivers/core/root.c2
-rw-r--r--drivers/core/uclass.c31
4 files changed, 37 insertions, 36 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 55ba281be0d..c73c339d18c 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -30,9 +30,9 @@
* @dev: The device that is to be stripped of its children
* @return 0 on success, -ve on error
*/
-static int device_chld_unbind(struct device *dev)
+static int device_chld_unbind(struct udevice *dev)
{
- struct device *pos, *n;
+ struct udevice *pos, *n;
int ret, saved_ret = 0;
assert(dev);
@@ -51,9 +51,9 @@ static int device_chld_unbind(struct device *dev)
* @dev: The device whose children are to be removed
* @return 0 on success, -ve on error
*/
-static int device_chld_remove(struct device *dev)
+static int device_chld_remove(struct udevice *dev)
{
- struct device *pos, *n;
+ struct udevice *pos, *n;
int ret;
assert(dev);
@@ -67,10 +67,10 @@ static int device_chld_remove(struct device *dev)
return 0;
}
-int device_bind(struct device *parent, struct driver *drv, const char *name,
- void *platdata, int of_offset, struct device **devp)
+int device_bind(struct udevice *parent, struct driver *drv, const char *name,
+ void *platdata, int of_offset, struct udevice **devp)
{
- struct device *dev;
+ struct udevice *dev;
struct uclass *uc;
int ret = 0;
@@ -82,7 +82,7 @@ int device_bind(struct device *parent, struct driver *drv, const char *name,
if (ret)
return ret;
- dev = calloc(1, sizeof(struct device));
+ dev = calloc(1, sizeof(struct udevice));
if (!dev)
return -ENOMEM;
@@ -129,8 +129,8 @@ fail_bind:
return ret;
}
-int device_bind_by_name(struct device *parent, const struct driver_info *info,
- struct device **devp)
+int device_bind_by_name(struct udevice *parent, const struct driver_info *info,
+ struct udevice **devp)
{
struct driver *drv;
@@ -142,7 +142,7 @@ int device_bind_by_name(struct device *parent, const struct driver_info *info,
-1, devp);
}
-int device_unbind(struct device *dev)
+int device_unbind(struct udevice *dev)
{
struct driver *drv;
int ret;
@@ -181,7 +181,7 @@ int device_unbind(struct device *dev)
* device_free() - Free memory buffers allocated by a device
* @dev: Device that is to be started
*/
-static void device_free(struct device *dev)
+static void device_free(struct udevice *dev)
{
int size;
@@ -200,7 +200,7 @@ static void device_free(struct device *dev)
}
}
-int device_probe(struct device *dev)
+int device_probe(struct udevice *dev)
{
struct driver *drv;
int size = 0;
@@ -279,7 +279,7 @@ fail:
return ret;
}
-int device_remove(struct device *dev)
+int device_remove(struct udevice *dev)
{
struct driver *drv;
int ret;
@@ -327,7 +327,7 @@ err:
return ret;
}
-void *dev_get_platdata(struct device *dev)
+void *dev_get_platdata(struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device", __func__);
@@ -337,7 +337,7 @@ void *dev_get_platdata(struct device *dev)
return dev->platdata;
}
-void *dev_get_priv(struct device *dev)
+void *dev_get_priv(struct udevice *dev)
{
if (!dev) {
dm_warn("%s: null device", __func__);
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 4f2c12631d4..205b140ef3d 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -60,13 +60,13 @@ struct uclass_driver *lists_uclass_lookup(enum uclass_id id)
return NULL;
}
-int lists_bind_drivers(struct device *parent)
+int lists_bind_drivers(struct udevice *parent)
{
struct driver_info *info =
ll_entry_start(struct driver_info, driver_info);
const int n_ents = ll_entry_count(struct driver_info, driver_info);
struct driver_info *entry;
- struct device *dev;
+ struct udevice *dev;
int result = 0;
int ret;
@@ -116,12 +116,12 @@ static int driver_check_compatible(const void *blob, int offset,
return -ENOENT;
}
-int lists_bind_fdt(struct device *parent, const void *blob, int offset)
+int lists_bind_fdt(struct udevice *parent, const void *blob, int offset)
{
struct driver *driver = ll_entry_start(struct driver, driver);
const int n_ents = ll_entry_count(struct driver, driver);
struct driver *entry;
- struct device *dev;
+ struct udevice *dev;
const char *name;
int result = 0;
int ret;
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 407bc0d0464..4977875c7f9 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -24,7 +24,7 @@ static const struct driver_info root_info = {
.name = "root_driver",
};
-struct device *dm_root(void)
+struct udevice *dm_root(void)
{
if (!gd->dm_root) {
dm_warn("Virtual root driver does not exist!\n");
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index 4df5a8bd399..f6867e4a232 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -101,7 +101,7 @@ fail_mem:
int uclass_destroy(struct uclass *uc)
{
struct uclass_driver *uc_drv;
- struct device *dev, *tmp;
+ struct udevice *dev, *tmp;
int ret;
list_for_each_entry_safe(dev, tmp, &uc->dev_head, uclass_node) {
@@ -137,10 +137,10 @@ int uclass_get(enum uclass_id id, struct uclass **ucp)
return 0;
}
-int uclass_find_device(enum uclass_id id, int index, struct device **devp)
+int uclass_find_device(enum uclass_id id, int index, struct udevice **devp)
{
struct uclass *uc;
- struct device *dev;
+ struct udevice *dev;
int ret;
*devp = NULL;
@@ -158,9 +158,9 @@ int uclass_find_device(enum uclass_id id, int index, struct device **devp)
return -ENODEV;
}
-int uclass_get_device(enum uclass_id id, int index, struct device **devp)
+int uclass_get_device(enum uclass_id id, int index, struct udevice **devp)
{
- struct device *dev;
+ struct udevice *dev;
int ret;
*devp = NULL;
@@ -177,10 +177,10 @@ int uclass_get_device(enum uclass_id id, int index, struct device **devp)
return 0;
}
-int uclass_first_device(enum uclass_id id, struct device **devp)
+int uclass_first_device(enum uclass_id id, struct udevice **devp)
{
struct uclass *uc;
- struct device *dev;
+ struct udevice *dev;
int ret;
*devp = NULL;
@@ -190,7 +190,7 @@ int uclass_first_device(enum uclass_id id, struct device **devp)
if (list_empty(&uc->dev_head))
return 0;
- dev = list_first_entry(&uc->dev_head, struct device, uclass_node);
+ dev = list_first_entry(&uc->dev_head, struct udevice, uclass_node);
ret = device_probe(dev);
if (ret)
return ret;
@@ -199,16 +199,17 @@ int uclass_first_device(enum uclass_id id, struct device **devp)
return 0;
}
-int uclass_next_device(struct device **devp)
+int uclass_next_device(struct udevice **devp)
{
- struct device *dev = *devp;
+ struct udevice *dev = *devp;
int ret;
*devp = NULL;
if (list_is_last(&dev->uclass_node, &dev->uclass->dev_head))
return 0;
- dev = list_entry(dev->uclass_node.next, struct device, uclass_node);
+ dev = list_entry(dev->uclass_node.next, struct udevice,
+ uclass_node);
ret = device_probe(dev);
if (ret)
return ret;
@@ -217,7 +218,7 @@ int uclass_next_device(struct device **devp)
return 0;
}
-int uclass_bind_device(struct device *dev)
+int uclass_bind_device(struct udevice *dev)
{
struct uclass *uc;
int ret;
@@ -237,7 +238,7 @@ int uclass_bind_device(struct device *dev)
return 0;
}
-int uclass_unbind_device(struct device *dev)
+int uclass_unbind_device(struct udevice *dev)
{
struct uclass *uc;
int ret;
@@ -253,7 +254,7 @@ int uclass_unbind_device(struct device *dev)
return 0;
}
-int uclass_post_probe_device(struct device *dev)
+int uclass_post_probe_device(struct udevice *dev)
{
struct uclass_driver *uc_drv = dev->uclass->uc_drv;
@@ -263,7 +264,7 @@ int uclass_post_probe_device(struct device *dev)
return 0;
}
-int uclass_pre_remove_device(struct device *dev)
+int uclass_pre_remove_device(struct udevice *dev)
{
struct uclass_driver *uc_drv;
struct uclass *uc;