diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-04 10:56:18 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-04 10:56:24 +0200 |
commit | 50c075ba436099cb440d50ce4702a53e24527011 (patch) | |
tree | 6a7ef9a67ea00d8367c5b4aad92ed67d8f78f064 /drivers/base | |
parent | 638e059aba994dc8a77f81ad5e826f1706aecc00 (diff) | |
download | barebox-50c075ba436099cb440d50ce4702a53e24527011.tar.gz barebox-50c075ba436099cb440d50ce4702a53e24527011.tar.xz |
driver: move dev_get_drvdata out of CONFIG_CMD_DEVINFO
dev_get_drvdata accidently is inside #ifdef CONFIG_CMD_DEVINFO.
Move it out of there.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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; |