dm: rename device struct to udevice
using UBI and DM together leads in compiler error, as
both define a "struct device", so rename "struct device"
in include/dm/device.h to "struct udevice", as we use
linux code (MTD/UBI/UBIFS some USB code,...) and cannot
change the linux "struct device"
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Marek Vasut <marex@denx.de>
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 55ba281..c73c339 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 @@
* @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 @@
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 @@
if (ret)
return ret;
- dev = calloc(1, sizeof(struct device));
+ dev = calloc(1, sizeof(struct udevice));
if (!dev)
return -ENOMEM;
@@ -129,8 +129,8 @@
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 @@
-1, devp);
}
-int device_unbind(struct device *dev)
+int device_unbind(struct udevice *dev)
{
struct driver *drv;
int ret;
@@ -181,7 +181,7 @@
* 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 @@
}
}
-int device_probe(struct device *dev)
+int device_probe(struct udevice *dev)
{
struct driver *drv;
int size = 0;
@@ -279,7 +279,7 @@
return ret;
}
-int device_remove(struct device *dev)
+int device_remove(struct udevice *dev)
{
struct driver *drv;
int ret;
@@ -327,7 +327,7 @@
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 @@
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__);