diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2012-02-09 16:57:07 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-03-27 12:20:14 -0400 |
commit | c9b0546a59293cabf54c85e1218da595af3274ff (patch) | |
tree | a74dd0315e163c1daaf55abf9087801d84ba8ec0 /drivers/mmc/core | |
parent | 296e0b0357e09fdc6f307953da51c0e5da5b84e7 (diff) |
mmc: simplify mmc_cd_gpio_request() by removing two parameters
Calculate the IRQ number, using gpio_to_irq() and use fixed flags: trigger
on both edges. This makes two out of four arguments of the
mmc_cd_gpio_request() function redundant.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/cd-gpio.c | 13 |
1 files changed, 9 insertions, 4 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 | ||