summaryrefslogtreecommitdiffstats
path: root/drivers/mci/mci-core.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-05-26 15:06:53 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-05-30 12:18:27 +0200
commit73b0d228e5b00365e7289e9c258acb8de3f716b3 (patch)
treeb17c82b3a4f33d52fdd26c52086e1fa7eaac97a3 /drivers/mci/mci-core.c
parent4a4f2f20b8873224983ab9b78173f9bc0564fa33 (diff)
downloadbarebox-73b0d228e5b00365e7289e9c258acb8de3f716b3.tar.gz
barebox-73b0d228e5b00365e7289e9c258acb8de3f716b3.tar.xz
driver: Attach info callback to device, not to driver
Since the info is device specific and not driver specific, attach the callback to the device. This makes it possible to have a info callback for a device which does not have a driver attached. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/mci-core.c')
-rw-r--r--drivers/mci/mci-core.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index f238cea54a..58db827d01 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1282,7 +1282,6 @@ static int mci_sd_read(struct block_device *blk, void *buffer, int block,
/* ------------------ attach to the device API --------------------------- */
-#ifdef CONFIG_MCI_INFO
/**
* Extract the Manufacturer ID from the CID
* @param mci Instance data
@@ -1408,7 +1407,6 @@ static void mci_info(struct device_d *mci_dev)
printf(" Manufacturing date: %u.%u\n", extract_mtd_month(mci),
extract_mtd_year(mci));
}
-#endif
/**
* Check if the MCI card is already probed
@@ -1617,6 +1615,9 @@ static int mci_probe(struct device_d *mci_dev)
goto on_error;
}
+ if (IS_ENABLED(CONFIG_MCI_INFO))
+ mci_dev->info = mci_info;
+
#ifdef CONFIG_MCI_STARTUP
/* if enabled, probe the attached card immediately */
mci_card_probe(mci);
@@ -1632,9 +1633,6 @@ on_error:
static struct driver_d mci_driver = {
.name = "mci",
.probe = mci_probe,
-#ifdef CONFIG_MCI_INFO
- .info = mci_info,
-#endif
};
static int mci_init(void)