aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx3/mx31moboard-marxbot.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mx3/mx31moboard-marxbot.c')
-rw-r--r--arch/arm/mach-mx3/mx31moboard-marxbot.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c
index 4fc271145b0c..53ce7ff0637c 100644
--- a/arch/arm/mach-mx3/mx31moboard-marxbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c
@@ -60,14 +60,40 @@ static int marxbot_sdhc2_get_ro(struct device *dev)
60static int marxbot_sdhc2_init(struct device *dev, irq_handler_t detect_irq, 60static int marxbot_sdhc2_init(struct device *dev, irq_handler_t detect_irq,
61 void *data) 61 void *data)
62{ 62{
63 return request_irq(gpio_to_irq(SDHC2_CD), detect_irq, 63 int ret;
64
65 ret = gpio_request(SDHC2_CD, "sdhc-detect");
66 if (ret)
67 return ret;
68
69 gpio_direction_input(SDHC2_CD);
70
71 ret = gpio_request(SDHC2_WP, "sdhc-wp");
72 if (ret)
73 goto err_gpio_free;
74 gpio_direction_input(SDHC2_WP);
75
76 ret = request_irq(gpio_to_irq(SDHC2_CD), detect_irq,
64 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 77 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
65 "sdhc2-card-detect", data); 78 "sdhc2-card-detect", data);
79 if (ret)
80 goto err_gpio_free_2;
81
82 return 0;
83
84err_gpio_free_2:
85 gpio_free(SDHC2_WP);
86err_gpio_free:
87 gpio_free(SDHC2_CD);
88
89 return ret;
66} 90}
67 91
68static void marxbot_sdhc2_exit(struct device *dev, void *data) 92static void marxbot_sdhc2_exit(struct device *dev, void *data)
69{ 93{
70 free_irq(gpio_to_irq(SDHC2_CD), data); 94 free_irq(gpio_to_irq(SDHC2_CD), data);
95 gpio_free(SDHC2_WP);
96 gpio_free(SDHC2_CD);
71} 97}
72 98
73static struct imxmmc_platform_data sdhc2_pdata = { 99static struct imxmmc_platform_data sdhc2_pdata = {