9
0
Fork 0

imx/devices: switch to add_generic_device

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2011-07-22 18:41:01 +08:00
parent 6f3aa82310
commit 826708d5d8
1 changed files with 3 additions and 16 deletions

View File

@ -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)