From 0e732aa4c973d969ff9720e96bd228be7a0df4b8 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Thu, 9 Feb 2012 22:57:07 +0100 Subject: [PATCH] --- yaml --- r: 297358 b: refs/heads/master c: c9b0546a59293cabf54c85e1218da595af3274ff h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/mmc/core/cd-gpio.c | 13 +++++++++---- trunk/include/linux/mmc/cd-gpio.h | 3 +-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index ed98cf8120bb..c65240051bcd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 296e0b0357e09fdc6f307953da51c0e5da5b84e7 +refs/heads/master: c9b0546a59293cabf54c85e1218da595af3274ff diff --git a/trunk/drivers/mmc/core/cd-gpio.c b/trunk/drivers/mmc/core/cd-gpio.c index 082202ae4a03..29de31e260dd 100644 --- a/trunk/drivers/mmc/core/cd-gpio.c +++ b/trunk/drivers/mmc/core/cd-gpio.c @@ -28,13 +28,17 @@ static irqreturn_t mmc_cd_gpio_irqt(int irq, void *dev_id) return IRQ_HANDLED; } -int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio, - unsigned int irq, unsigned long flags) +int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio) { size_t len = strlen(dev_name(host->parent)) + 4; - struct mmc_cd_gpio *cd = kmalloc(sizeof(*cd) + len, GFP_KERNEL); + struct mmc_cd_gpio *cd; + int irq = gpio_to_irq(gpio); int ret; + if (irq < 0) + return irq; + + cd = kmalloc(sizeof(*cd) + len, GFP_KERNEL); if (!cd) return -ENOMEM; @@ -45,7 +49,8 @@ int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio, goto egpioreq; ret = request_threaded_irq(irq, NULL, mmc_cd_gpio_irqt, - flags, cd->label, host); + IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + cd->label, host); if (ret < 0) goto eirqreq; diff --git a/trunk/include/linux/mmc/cd-gpio.h b/trunk/include/linux/mmc/cd-gpio.h index a8e469783318..cefaba038ccb 100644 --- a/trunk/include/linux/mmc/cd-gpio.h +++ b/trunk/include/linux/mmc/cd-gpio.h @@ -12,8 +12,7 @@ #define MMC_CD_GPIO_H struct mmc_host; -int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio, - unsigned int irq, unsigned long flags); +int mmc_cd_gpio_request(struct mmc_host *host, unsigned int gpio); void mmc_cd_gpio_free(struct mmc_host *host); #endif