diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-07-22 18:41:01 +0800 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-07-23 09:22:50 +0800 |
commit | 826708d5d8c3d7e3b5cd518ea44fb0bdbaad0175 (patch) | |
tree | 16030dfd19f283e089bb34dcac9a54c377deb943 /arch/arm/mach-imx | |
parent | 6f3aa8231064b9ea0b165423702265a7989294b7 (diff) | |
download | barebox-826708d5d8c3d7e3b5cd518ea44fb0bdbaad0175.tar.gz barebox-826708d5d8c3d7e3b5cd518ea44fb0bdbaad0175.tar.xz |
imx/devices: switch to add_generic_device
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/devices.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c index 6503c305a1..5b062f5f0f 100644 --- a/arch/arm/mach-imx/devices.c +++ b/arch/arm/mach-imx/devices.c @@ -2,23 +2,10 @@ #include <driver.h> #include <mach/devices.h> -static struct device_d *imx_add_device(char *name, int id, void *base, int size, void *pdata) +static inline struct device_d *imx_add_device(char *name, int id, void *base, int size, void *pdata) { - struct device_d *dev; - - dev = xzalloc(sizeof(*dev)); - strcpy(dev->name,name); - dev->id = id; - dev->resource = xzalloc(sizeof(struct resource)); - dev->resource[0].start = (resource_size_t)base; - dev->resource[0].size = size; - dev->resource[0].flags = IORESOURCE_MEM; - dev->num_resources = 1; - dev->platform_data = pdata; - - register_device(dev); - - return 0; + return add_generic_device(name, id, NULL, (resource_size_t)base, size, + IORESOURCE_MEM, pdata); } struct device_d *imx_add_fec(void *base, struct fec_platform_data *pdata) |