Skip to contentSkip to conversation

mmc: at91_mci: remove the use of irq_to_gpio

RFC PATCH New Nicolas Ferre 4 participants 4 messages Aug 4, 2011 – Aug 5, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 mmc: at91_mci: remove the use of irq_to_gpio

Remove the use of irq_to_gpio() in the card detection interrupt handler. The information is available in the board structure and we can avoid using a function that has little meaning.

---
Ben, Arnd,

I have identified this use of irq_to_gpio() which can be remove immediatly.

 drivers/mmc/host/at91_mci.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/mmc/host/at91_mci.c +4 -1
index a4aa3af..351951c 100644
@@ -869,7 +869,10 @@ static irqreturn_t at91_mci_irq(int irq, void *devid)
 static irqreturn_t at91_mmc_det_irq(int irq, void *_host)
 {
 	struct at91mci_host *host = _host;
-	int present = !gpio_get_value(irq_to_gpio(irq));
+	int present;
+
+	/* if we are here is that the det_pin exists */
+	present = !gpio_get_value(host->board->det_pin);
 
 	/*
 	 * we expect this irq on both insert and remove,
Signature · 1 line
1.7.4.1
#1 lore raw

RFC PATCH 1/1 mmc: at91_mci: remove the use of irq_to_gpio

Hello.

Quoted 18 lines · Nicolas Ferre

Remove the use of irq_to_gpio() in the card detection interrupt handler. The information is available in the board structure and we can avoid using a function that has little meaning.

---
Ben, Arnd,

I have identified this use of irq_to_gpio() which can be remove immediatly.

 drivers/mmc/host/at91_mci.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/mmc/host/at91_mci.c +0 -0
index a4aa3af..351951c 100644

drivers/mmc/host/at91_mci.c static irqreturn_t at91_mci_irq(int irq, void *devid) · line 874

Quoted 7 lines
drivers/mmc/host/at91_mci.c +3 -1
@@ -869,7 +869,10 @@ static irqreturn_t at91_mci_irq(int irq, void *devid)
 static irqreturn_t at91_mmc_det_irq(int irq, void *_host)
 {
 	struct at91mci_host *host = _host;
-	int present = !gpio_get_value(irq_to_gpio(irq));
+	int present;
+
+	/* if we are here is that the det_pin exists */

Hm, this comment doesn't parse...

drivers/mmc/host/at91_mci.c static irqreturn_t at91_mci_irq(int irq, void *devid) · line 875

Quoted 1 line
drivers/mmc/host/at91_mci.c +1 -0
+	present = !gpio_get_value(host->board->det_pin);

WBR, Sergei

#2 lore raw

RFC PATCH 1/1 mmc: at91_mci: remove the use of irq_to_gpio

In reply to Nicolas Ferre
Quoted 3 lines · Nicolas Ferre

Remove the use of irq_to_gpio() in the card detection interrupt handler. The information is available in the board structure and we can avoid using a function that has little meaning.

thanks, looks good.

Quoted 28 lines

---
Ben, Arnd,

I have identified this use of irq_to_gpio() which can be remove immediatly.

 drivers/mmc/host/at91_mci.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/mmc/host/at91_mci.c +4 -1
index a4aa3af..351951c 100644
@@ -869,7 +869,10 @@ static irqreturn_t at91_mci_irq(int irq, void *devid)
 static irqreturn_t at91_mmc_det_irq(int irq, void *_host)
 {
 	struct at91mci_host *host = _host;
-	int present = !gpio_get_value(irq_to_gpio(irq));
+	int present;
+
+	/* if we are here is that the det_pin exists */
+	present = !gpio_get_value(host->board->det_pin);
 
 	/*
 	 * we expect this irq on both insert and remove,
Signature · 1 line
1.7.4.1
Signature · 3 lines
Ben Dooks, ben at fluff.org, http://www.fluff.org/ben/

Large Hadron Colada: A large Pina Colada that makes the universe disappear.