diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-05-26 15:06:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-05-30 12:18:27 +0200 |
commit | 73b0d228e5b00365e7289e9c258acb8de3f716b3 (patch) | |
tree | b17c82b3a4f33d52fdd26c52086e1fa7eaac97a3 /drivers/mci/atmel_mci.c | |
parent | 4a4f2f20b8873224983ab9b78173f9bc0564fa33 (diff) | |
download | barebox-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/atmel_mci.c')
-rw-r--r-- | drivers/mci/atmel_mci.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c index c5fd306a9a..b5873f967b 100644 --- a/drivers/mci/atmel_mci.c +++ b/drivers/mci/atmel_mci.c @@ -470,7 +470,6 @@ static int atmci_request(struct mci_host *mci, struct mci_cmd *cmd, struct mci_d return atmci_cmd_done(host, stat); } -#ifdef CONFIG_MCI_INFO static void atmci_info(struct device_d *mci_dev) { struct atmel_mci *host = mci_dev->priv; @@ -493,7 +492,6 @@ static void atmci_info(struct device_d *mci_dev) gpio_is_valid(pd->detect_pin) ? "yes" : "no"); } -#endif /* CONFIG_MCI_INFO */ /* * HSMCI (High Speed MCI) module is not fully compatible with MCI module. * HSMCI provides DMA support and a new config register but no more supports @@ -603,6 +601,9 @@ static int atmci_probe(struct device_d *hw_dev) else host->sdc_reg = ATMCI_SDCSEL_SLOT_A; + if (IS_ENABLED(CONFIG_MCI_INFO)) + hw_dev->info = atmci_info; + mci_register(&host->mci); return 0; @@ -617,8 +618,5 @@ err_gpio_cd_request: static struct driver_d atmci_driver = { .name = "atmel_mci", .probe = atmci_probe, -#ifdef CONFIG_MCI_INFO - .info = atmci_info, -#endif }; device_platform_driver(atmci_driver); |