diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-05 12:26:09 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-17 04:01:30 -0500 |
commit | 9d3d945a8d5be2c915f646e8dff8422486a77030 (patch) | |
tree | 7e0557484ef0e8c6de6e5da3f9d7b08ab1b5b2c4 /arch/arm/mach-imx/mach-mx21ads.c | |
parent | c194daad0e0de94ed5e03aa723eb56b4a3ae9738 (diff) |
ARM: imx: dynamically register mxc-mmc devices
... plus a trivial simplification of mx21ads_sdhc_init()
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/mach-mx21ads.c')
-rw-r--r-- | arch/arm/mach-imx/mach-mx21ads.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c index 4820a67b8abb..83c064a3cf4b 100644 --- a/arch/arm/mach-imx/mach-mx21ads.c +++ b/arch/arm/mach-imx/mach-mx21ads.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
27 | #include <mach/iomux-mx21.h> | 27 | #include <mach/iomux-mx21.h> |
28 | #include <mach/mxc_nand.h> | 28 | #include <mach/mxc_nand.h> |
29 | #include <mach/mmc.h> | ||
30 | 29 | ||
31 | #include "devices-imx21.h" | 30 | #include "devices-imx21.h" |
32 | #include "devices.h" | 31 | #include "devices.h" |
@@ -232,15 +231,8 @@ static int mx21ads_sdhc_get_ro(struct device *dev) | |||
232 | static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq, | 231 | static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq, |
233 | void *data) | 232 | void *data) |
234 | { | 233 | { |
235 | int ret; | 234 | return request_irq(IRQ_GPIOD(25), detect_irq, |
236 | |||
237 | ret = request_irq(IRQ_GPIOD(25), detect_irq, | ||
238 | IRQF_TRIGGER_FALLING, "mmc-detect", data); | 235 | IRQF_TRIGGER_FALLING, "mmc-detect", data); |
239 | if (ret) | ||
240 | goto out; | ||
241 | return 0; | ||
242 | out: | ||
243 | return ret; | ||
244 | } | 236 | } |
245 | 237 | ||
246 | static void mx21ads_sdhc_exit(struct device *dev, void *data) | 238 | static void mx21ads_sdhc_exit(struct device *dev, void *data) |
@@ -248,7 +240,7 @@ static void mx21ads_sdhc_exit(struct device *dev, void *data) | |||
248 | free_irq(IRQ_GPIOD(25), data); | 240 | free_irq(IRQ_GPIOD(25), data); |
249 | } | 241 | } |
250 | 242 | ||
251 | static struct imxmmc_platform_data mx21ads_sdhc_pdata = { | 243 | static const struct imxmmc_platform_data mx21ads_sdhc_pdata __initconst = { |
252 | .ocr_avail = MMC_VDD_29_30 | MMC_VDD_30_31, /* 3.0V */ | 244 | .ocr_avail = MMC_VDD_29_30 | MMC_VDD_30_31, /* 3.0V */ |
253 | .get_ro = mx21ads_sdhc_get_ro, | 245 | .get_ro = mx21ads_sdhc_get_ro, |
254 | .init = mx21ads_sdhc_init, | 246 | .init = mx21ads_sdhc_init, |
@@ -296,7 +288,7 @@ static void __init mx21ads_board_init(void) | |||
296 | imx21_add_imx_uart2(&uart_pdata_norts); | 288 | imx21_add_imx_uart2(&uart_pdata_norts); |
297 | imx21_add_imx_uart3(&uart_pdata_rts); | 289 | imx21_add_imx_uart3(&uart_pdata_rts); |
298 | imx21_add_imx_fb(&mx21ads_fb_data); | 290 | imx21_add_imx_fb(&mx21ads_fb_data); |
299 | mxc_register_device(&mxc_sdhc_device0, &mx21ads_sdhc_pdata); | 291 | imx21_add_mxc_mmc(0, &mx21ads_sdhc_pdata); |
300 | imx21_add_mxc_nand(&mx21ads_nand_board_info); | 292 | imx21_add_mxc_nand(&mx21ads_nand_board_info); |
301 | 293 | ||
302 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 294 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |