diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-07-29 15:17:38 +0800 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-07-30 02:05:27 +0800 |
commit | 6e2e7a67f224d1126220c6e16ef855975e6d7c74 (patch) | |
tree | 03c30b9a153c95f6c173e7fd01a2e29794938fb2 /drivers | |
parent | 4b68e2f5d6bde89e37799d4f2d6bf732e8a4d16c (diff) | |
download | barebox-6e2e7a67f224d1126220c6e16ef855975e6d7c74.tar.gz barebox-6e2e7a67f224d1126220c6e16ef855975e6d7c74.tar.xz |
mci-core: switch to resource
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mci/mci-core.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c index 3cf364ce7a..fea26916c6 100644 --- a/drivers/mci/mci-core.c +++ b/drivers/mci/mci-core.c @@ -1175,7 +1175,6 @@ static int mci_card_probe(struct device_d *mci_dev) { struct mci *mci = GET_MCI_DATA(mci_dev); struct mci_host *host = GET_MCI_PDATA(mci_dev); - struct device_d *disk_dev; struct ata_interface *p; int rc; @@ -1221,8 +1220,7 @@ static int mci_card_probe(struct device_d *mci_dev) * An MMC/SD card acts like an ordinary disk. * So, re-use the disk driver to gain access to this media */ - disk_dev = xzalloc(sizeof(struct device_d) + sizeof(struct ata_interface)); - p = (struct ata_interface*)&disk_dev[1]; + p = xzalloc(sizeof(struct ata_interface)); #ifdef CONFIG_MCI_WRITE p->write = mci_sd_write; @@ -1230,11 +1228,7 @@ static int mci_card_probe(struct device_d *mci_dev) p->read = mci_sd_read; p->priv = mci_dev; - strcpy(disk_dev->name, "disk"); - disk_dev->size = mci->capacity; - disk_dev->platform_data = p; - - register_device(disk_dev); + add_generic_device("disk", -1, NULL, 0, mci->capacity, IORESOURCE_MEM, p); pr_debug("SD Card successfully added\n"); |