diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/driver.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 1def2f85e7..cf96081da9 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c @@ -350,6 +350,21 @@ void devices_shutdown(void) } } +int dev_get_drvdata(struct device_d *dev, unsigned long *data) +{ + if (dev->of_id_entry) { + *data = dev->of_id_entry->data; + return 0; + } + + if (dev->id_entry) { + *data = dev->id_entry->driver_data; + return 0; + } + + return -ENODEV; +} + #ifdef CONFIG_CMD_DEVINFO static int do_devinfo_subtree(struct device_d *dev, int depth) { @@ -384,21 +399,6 @@ static int do_devinfo_subtree(struct device_d *dev, int depth) return 0; } -int dev_get_drvdata(struct device_d *dev, unsigned long *data) -{ - if (dev->of_id_entry) { - *data = dev->of_id_entry->data; - return 0; - } - - if (dev->id_entry) { - *data = dev->id_entry->driver_data; - return 0; - } - - return -ENODEV; -} - static int do_devinfo(int argc, char *argv[]) { struct device_d *dev; |