diff options
-rw-r--r-- | drivers/mmc/core/cd-gpio.c | 13 | ||||
-rw-r--r-- | include/linux/mmc/cd-gpio.h | 3 |
2 files changed, 10 insertions, 6 deletions
diff --git a/drivers/mmc/core/cd-gpio.c b/drivers/mmc/core/cd-gpio.c index 082202ae4a03..29de31e260dd 100644 --- a/drivers/mmc/core/cd-gpio.c +++ b/drivers/mmc/core/cd-gpio.c | |||
@@ -28,13 +28,17 @@ static irqreturn_t mmc_cd_gpio_irqt(int irq, void *dev_id) | |||
28 | return IRQ_HANDLED; | 28 | return IRQ_HANDLED; |
29 | } | 29 | } |
30 | 30 | ||
31 | int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio, | 31 | int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio) |
32 | unsigned int irq, unsigned long flags) | ||
33 | { | 32 | { |
34 | size_t len = strlen(dev_name(host->parent)) + 4; | 33 | size_t len = strlen(dev_name(host->parent)) + 4; |
35 | struct mmc_cd_gpio *cd = kmalloc(sizeof(*cd) + len, GFP_KERNEL); | 34 | struct mmc_cd_gpio *cd; |
35 | int irq = gpio_to_irq(gpio); | ||
36 | int ret; | 36 | int ret; |
37 | 37 | ||
38 | if (irq < 0) | ||
39 | return irq; | ||
40 | |||
41 | cd = kmalloc(sizeof(*cd) + len, GFP_KERNEL); | ||
38 | if (!cd) | 42 | if (!cd) |
39 | return -ENOMEM; | 43 | return -ENOMEM; |
40 | 44 | ||
@@ -45,7 +49,8 @@ int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio, | |||
45 | goto egpioreq; | 49 | goto egpioreq; |
46 | 50 | ||
47 | ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt, | 51 | ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt, |
48 | flags, cd->label, host); | 52 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, |
53 | cd->label, host); | ||
49 | if (ret < 0) | 54 | if (ret < 0) |
50 | goto eirqreq; | 55 | goto eirqreq; |
51 | 56 | ||
diff --git a/include/linux/mmc/cd-gpio.h b/include/linux/mmc/cd-gpio.h index a8e469783318..cefaba038ccb 100644 --- a/include/linux/mmc/cd-gpio.h +++ b/include/linux/mmc/cd-gpio.h | |||
@@ -12,8 +12,7 @@ | |||
12 | #define MMC_CD_GPIO_H | 12 | #define MMC_CD_GPIO_H |
13 | 13 | ||
14 | struct mmc_host; | 14 | struct mmc_host; |
15 | int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio, | 15 | int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio); |
16 | unsigned int irq, unsigned long flags); | ||
17 | void mmc_cd_gpio_free(struct mmc_host *host); | 16 | void mmc_cd_gpio_free(struct mmc_host *host); |
18 | 17 | ||
19 | #endif | 18 | #endif |