Skip to contentSkip to conversation

pcmcia: pxa: replace IRQ_GPIO() with gpio_to_irq()

PATCH Superseded Axel Lin 3 participants 3 messages Dec 5, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 pcmcia: pxa: replace IRQ_GPIO() with gpio_to_irq()

Since commit 6384fd "ARM: pxa: rename IRQ_GPIO to PXA_GPIO_TO_IRQ", I got buid errors due to implicit declaration of function 'IRQ_GPIO'.

Use common gpio_to_irq() to replace machine dependant macro IRQ_GPIO().

Cc Marek Vasut <[email protected]>
Cc Ian Molton <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc Eric Miao <[email protected]>
Cc Russell King <[email protected]>

---
I got the build error on linux-next,
this patch is against linux-next 20111205.

Axel

 drivers/pcmcia/pxa2xx_e740.c      |   11 +++++++----
 drivers/pcmcia/pxa2xx_palmld.c    |    2 +-
 drivers/pcmcia/pxa2xx_palmtc.c    |    2 +-
 drivers/pcmcia/pxa2xx_stargate2.c |    6 ++++--
 drivers/pcmcia/pxa2xx_vpac270.c   |    4 ++--
 5 files changed, 15 insertions(+), 10 deletions(-)
drivers/pcmcia/pxa2xx_e740.c +7 -4
index 8bfbd4d..17cd2ce 100644
@@ -26,20 +26,23 @@
 static struct pcmcia_irqs cd_irqs[] = {
 	{
 		.sock = 0,
-		.irq  = IRQ_GPIO(GPIO_E740_PCMCIA_CD0),
 		.str  = "CF card detect"
 	},
 	{
 		.sock = 1,
-		.irq  = IRQ_GPIO(GPIO_E740_PCMCIA_CD1),
 		.str  = "Wifi switch"
 	},
 };
 
 static int e740_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
-	skt->socket.pci_irq = skt->nr == 0 ? IRQ_GPIO(GPIO_E740_PCMCIA_RDY0) :
-				IRQ_GPIO(GPIO_E740_PCMCIA_RDY1);
+	if (skt->nr == 0)
+		skt->socket.pci_irq = gpio_to_irq(GPIO_E740_PCMCIA_RDY0);
+	else
+		skt->socket.pci_irq = gpio_to_irq(GPIO_E740_PCMCIA_RDY1);
+
+	cd_irqs[0].irq = gpio_to_irq(GPIO_E740_PCMCIA_CD0);
+	cd_irqs[1].irq = gpio_to_irq(GPIO_E740_PCMCIA_CD1);
 
 	return soc_pcmcia_request_irqs(skt, &cd_irqs[skt->nr], 1);
 }
drivers/pcmcia/pxa2xx_palmld.c +1 -1
index d589ad1..6a8e011 100644
@@ -33,7 +33,7 @@ static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 	ret = gpio_request_array(palmld_pcmcia_gpios,
 				ARRAY_SIZE(palmld_pcmcia_gpios));
 
-	skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY);
+	skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMLD_PCMCIA_READY);
 
 	return ret;
 }
drivers/pcmcia/pxa2xx_palmtc.c +1 -1
index 9c6a04b..9e38de7 100644
@@ -37,7 +37,7 @@ static int palmtc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 	ret = gpio_request_array(palmtc_pcmcia_gpios,
 				ARRAY_SIZE(palmtc_pcmcia_gpios));
 
-	skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMTC_PCMCIA_READY);
+	skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMTC_PCMCIA_READY);
 
 	return ret;
 }
drivers/pcmcia/pxa2xx_stargate2.c +4 -2
index 9396222..6c2366b 100644
@@ -34,7 +34,7 @@
 #define SG2_S0_GPIO_READY	81
 
 static struct pcmcia_irqs irqs[] = {
-	{ 0, IRQ_GPIO(SG2_S0_GPIO_DETECT), "PCMCIA0 CD" },
+	{.sock = 0, .str = "PCMCIA0 CD" },
 };
 
 static struct gpio sg2_pcmcia_gpios[] = {
@@ -44,7 +44,9 @@ static struct gpio sg2_pcmcia_gpios[] = {
 
 static int sg2_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
-	skt->socket.pci_irq = IRQ_GPIO(SG2_S0_GPIO_READY);
+	skt->socket.pci_irq = gpio_to_irq(SG2_S0_GPIO_READY);
+	irqs[0].irq = gpio_to_irq(SG2_S0_GPIO_DETECT);
+
 	return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 }
 
drivers/pcmcia/pxa2xx_vpac270.c +2 -2
index 66ab92c..61b17d2 100644
@@ -38,12 +38,10 @@ static struct gpio vpac270_cf_gpios[] = {
 static struct pcmcia_irqs cd_irqs[] = {
 	{
 		.sock = 0,
-		.irq  = IRQ_GPIO(GPIO84_VPAC270_PCMCIA_CD),
 		.str  = "PCMCIA CD"
 	},
 	{
 		.sock = 1,
-		.irq  = IRQ_GPIO(GPIO17_VPAC270_CF_CD),
 		.str  = "CF CD"
 	},
 };
@@ -57,6 +55,7 @@ static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 				ARRAY_SIZE(vpac270_pcmcia_gpios));
 
 		skt->socket.pci_irq = gpio_to_irq(GPIO35_VPAC270_PCMCIA_RDY);
+		cd_irqs[0].irq = gpio_to_irq(GPIO84_VPAC270_PCMCIA_CD);
 
 		if (!ret)
 			ret = soc_pcmcia_request_irqs(skt, &cd_irqs[0], 1);
@@ -65,6 +64,7 @@ static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 				ARRAY_SIZE(vpac270_cf_gpios));
 
 		skt->socket.pci_irq = gpio_to_irq(GPIO12_VPAC270_CF_RDY);
+		cd_irqs[1].irq = gpio_to_irq(GPIO17_VPAC270_CF_CD);
 
 		if (!ret)
 			ret = soc_pcmcia_request_irqs(skt, &cd_irqs[1], 1);
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Axel Lin

Since commit 6384fd "ARM: pxa: rename IRQ_GPIO to PXA_GPIO_TO_IRQ", I got buid errors due to implicit declaration of function 'IRQ_GPIO'.

Use common gpio_to_irq() to replace machine dependant macro IRQ_GPIO().

Quoted 7 lines
Cc Marek Vasut <[email protected]>
Cc Ian Molton <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc Eric Miao <[email protected]>
Cc Russell King <[email protected]>

Looks fine to me.

Quoted 132 lines

---
I got the build error on linux-next,
this patch is against linux-next 20111205.

Axel

?drivers/pcmcia/pxa2xx_e740.c ? ? ?| ? 11 +++++++----
?drivers/pcmcia/pxa2xx_palmld.c ? ?| ? ?2 +-
?drivers/pcmcia/pxa2xx_palmtc.c ? ?| ? ?2 +-
?drivers/pcmcia/pxa2xx_stargate2.c | ? ?6 ++++--
?drivers/pcmcia/pxa2xx_vpac270.c ? | ? ?4 ++--

?5 files changed, 15 insertions(+), 10 deletions(-)

drivers/pcmcia/pxa2xx_e740.c +0 -1
index 8bfbd4d..17cd2ce 100644
@@ -26,20 +26,23 @@
 ?static struct pcmcia_irqs cd_irqs[] = {
 ? ? ? ?{
 ? ? ? ? ? ? ? ?.sock = 0,
- ? ? ? ? ? ? ? .irq ?= IRQ_GPIO(GPIO_E740_PCMCIA_CD0),

? ? ? ? ? ? ? ?.str ?= "CF card detect"
? ? ? ?},
? ? ? ?{
? ? ? ? ? ? ? ?.sock = 1,
- ? ? ? ? ? ? ? .irq ?= IRQ_GPIO(GPIO_E740_PCMCIA_CD1), ? ? ? ? ? ? ? ?.str ?= "Wifi switch"
? ? ? ?},
?};

?static int e740_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
?{
- ? ? ? skt->socket.pci_irq = skt->nr == 0 ? IRQ_GPIO(GPIO_E740_PCMCIA_RDY0) :
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? IRQ_GPIO(GPIO_E740_PCMCIA_RDY1);
+ ? ? ? if (skt->nr == 0)
+ ? ? ? ? ? ? ? skt->socket.pci_irq = gpio_to_irq(GPIO_E740_PCMCIA_RDY0);
+ ? ? ? else
+ ? ? ? ? ? ? ? skt->socket.pci_irq = gpio_to_irq(GPIO_E740_PCMCIA_RDY1); +
+ ? ? ? cd_irqs[0].irq = gpio_to_irq(GPIO_E740_PCMCIA_CD0);
+ ? ? ? cd_irqs[1].irq = gpio_to_irq(GPIO_E740_PCMCIA_CD1);

? ? ? ?return soc_pcmcia_request_irqs(skt, &cd_irqs[skt->nr], 1); ?}

drivers/pcmcia/pxa2xx_palmld.c +1 -1
index d589ad1..6a8e011 100644
@@ -33,7 +33,7 @@ static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 ? ? ? ?ret = gpio_request_array(palmld_pcmcia_gpios,
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(palmld_pcmcia_gpios));
 
- ? ? ? skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY);
+ ? ? ? skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMLD_PCMCIA_READY);
 
 ? ? ? ?return ret;
 ?}
drivers/pcmcia/pxa2xx_palmtc.c +1 -1
index 9c6a04b..9e38de7 100644
@@ -37,7 +37,7 @@ static int palmtc_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 ? ? ? ?ret = gpio_request_array(palmtc_pcmcia_gpios,
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(palmtc_pcmcia_gpios));
 
- ? ? ? skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMTC_PCMCIA_READY);
+ ? ? ? skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMTC_PCMCIA_READY);
 
 ? ? ? ?return ret;
 ?}
drivers/pcmcia/pxa2xx_stargate2.c +0 -0
index 9396222..6c2366b 100644
@@ -34,7 +34,7 @@

?#define SG2_S0_GPIO_READY ? ? ?81

?static struct pcmcia_irqs irqs[] = {
- ? ? ? { 0, IRQ_GPIO(SG2_S0_GPIO_DETECT), "PCMCIA0 CD" },
+ ? ? ? {.sock = 0, .str = "PCMCIA0 CD" },
?};

?static struct gpio sg2_pcmcia_gpios[] = {

drivers/pcmcia/pxa2xx_stargate2.c +3 -1
@@ -44,7 +44,9 @@ static struct gpio sg2_pcmcia_gpios[] = {
 
 ?static int sg2_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 ?{
- ? ? ? skt->socket.pci_irq = IRQ_GPIO(SG2_S0_GPIO_READY);
+ ? ? ? skt->socket.pci_irq = gpio_to_irq(SG2_S0_GPIO_READY);
+ ? ? ? irqs[0].irq = gpio_to_irq(SG2_S0_GPIO_DETECT);
+
 ? ? ? ?return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs));
 ?}
 
drivers/pcmcia/pxa2xx_vpac270.c +0 -1
index 66ab92c..61b17d2 100644
@@ -38,12 +38,10 @@ static struct gpio vpac270_cf_gpios[] = {
 ?static struct pcmcia_irqs cd_irqs[] = {
 ? ? ? ?{
 ? ? ? ? ? ? ? ?.sock = 0,
- ? ? ? ? ? ? ? .irq ?= IRQ_GPIO(GPIO84_VPAC270_PCMCIA_CD),

? ? ? ? ? ? ? ?.str ?= "PCMCIA CD"
? ? ? ?},
? ? ? ?{
? ? ? ? ? ? ? ?.sock = 1,
- ? ? ? ? ? ? ? .irq ?= IRQ_GPIO(GPIO17_VPAC270_CF_CD), ? ? ? ? ? ? ? ?.str ?= "CF CD"
? ? ? ?},
?};

drivers/pcmcia/pxa2xx_vpac270.c +2 -1
@@ -57,6 +55,7 @@ static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(vpac270_pcmcia_gpios));
 
 ? ? ? ? ? ? ? ?skt->socket.pci_irq = gpio_to_irq(GPIO35_VPAC270_PCMCIA_RDY);
+ ? ? ? ? ? ? ? cd_irqs[0].irq = gpio_to_irq(GPIO84_VPAC270_PCMCIA_CD);
 
 ? ? ? ? ? ? ? ?if (!ret)
 ? ? ? ? ? ? ? ? ? ? ? ?ret = soc_pcmcia_request_irqs(skt, &cd_irqs[0], 1);
@@ -65,6 +64,7 @@ static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ARRAY_SIZE(vpac270_cf_gpios));
 
 ? ? ? ? ? ? ? ?skt->socket.pci_irq = gpio_to_irq(GPIO12_VPAC270_CF_RDY);
+ ? ? ? ? ? ? ? cd_irqs[1].irq = gpio_to_irq(GPIO17_VPAC270_CF_CD);
 
 ? ? ? ? ? ? ? ?if (!ret)
 ? ? ? ? ? ? ? ? ? ? ? ?ret = soc_pcmcia_request_irqs(skt, &cd_irqs[1], 1);
--

1.7.5.4

Acked-by
#2 lore raw
Quoted 14 lines · Axel Lin
Quoted 5 lines

Since commit 6384fd "ARM: pxa: rename IRQ_GPIO to PXA_GPIO_TO_IRQ", I got buid errors due to implicit declaration of function 'IRQ_GPIO'.

Use common gpio_to_irq() to replace machine dependant macro IRQ_GPIO().

Quoted 7 lines
Cc Marek Vasut <[email protected]>
Cc Ian Molton <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc Eric Miao <[email protected]>
Cc Russell King <[email protected]>
Quoted 3 lines

Looks fine to me.

I did a quick skim over the patch: