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/mxs.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/mxs.c')
-rw-r--r-- | drivers/mci/mxs.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c index 9dee863aaf..e6f40ebc35 100644 --- a/drivers/mci/mxs.c +++ b/drivers/mci/mxs.c @@ -536,7 +536,6 @@ static void mxs_mci_set_ios(struct mci_host *host, struct mci_ios *ios) /* ----------------------------------------------------------------------- */ -#ifdef CONFIG_MCI_INFO const unsigned char bus_width[3] = { 1, 4, 8 }; static void mxs_mci_info(struct device_d *hw_dev) @@ -550,7 +549,6 @@ static void mxs_mci_info(struct device_d *hw_dev) printf(" Bus width: %u bit\n", bus_width[mxs_mci->bus_width]); printf("\n"); } -#endif static int mxs_mci_probe(struct device_d *hw_dev) { @@ -617,10 +615,11 @@ static int mxs_mci_probe(struct device_d *hw_dev) host->f_max, mxs_mci_get_unit_clock(mxs_mci) / 2 / 1); } -#ifdef CONFIG_MCI_INFO - mxs_mci->f_min = host->f_min; - mxs_mci->f_max = host->f_max; -#endif + if (IS_ENABLED(CONFIG_MCI_INFO)) { + mxs_mci->f_min = host->f_min; + mxs_mci->f_max = host->f_max; + hw_dev->info = mxs_mci_info; + } return mci_register(host); } @@ -628,8 +627,5 @@ static int mxs_mci_probe(struct device_d *hw_dev) static struct driver_d mxs_mci_driver = { .name = "mxs_mci", .probe = mxs_mci_probe, -#ifdef CONFIG_MCI_INFO - .info = mxs_mci_info, -#endif }; device_platform_driver(mxs_mci_driver); |