Re: [PATCH] pcmcia: pxa: replace IRQ_GPIO() with gpio_to_irq()

From: Eric Miao
Date: Mon Dec 05 2011 - 04:05:02 EST


On Mon, Dec 5, 2011 at 4:59 PM, Axel Lin <axel.lin@xxxxxxxxx> wrote:
> 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 <marek.vasut@xxxxxxxxx>
> Cc: Ian Molton <spyro@xxxxxxx>
> Cc: Jonathan Cameron <jic23@xxxxxxxxx>
> Cc: Haojian Zhuang <haojian.zhuang@xxxxxxxxxxx>
> Cc: Eric Miao <eric.y.miao@xxxxxxxxx>
> Cc: Russell King <linux@xxxxxxxxxxxxxxxx>
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>

Looks fine to me.

Acked-by: Eric Miao <eric.y.miao@xxxxxxxxx>

> ---
> 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(-)
>
> diff --git a/drivers/pcmcia/pxa2xx_e740.c b/drivers/pcmcia/pxa2xx_e740.c
> index 8bfbd4d..17cd2ce 100644
> --- a/drivers/pcmcia/pxa2xx_e740.c
> +++ b/drivers/pcmcia/pxa2xx_e740.c
> @@ -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);
> Â}
> diff --git a/drivers/pcmcia/pxa2xx_palmld.c b/drivers/pcmcia/pxa2xx_palmld.c
> index d589ad1..6a8e011 100644
> --- a/drivers/pcmcia/pxa2xx_palmld.c
> +++ b/drivers/pcmcia/pxa2xx_palmld.c
> @@ -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;
> Â}
> diff --git a/drivers/pcmcia/pxa2xx_palmtc.c b/drivers/pcmcia/pxa2xx_palmtc.c
> index 9c6a04b..9e38de7 100644
> --- a/drivers/pcmcia/pxa2xx_palmtc.c
> +++ b/drivers/pcmcia/pxa2xx_palmtc.c
> @@ -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;
> Â}
> diff --git a/drivers/pcmcia/pxa2xx_stargate2.c b/drivers/pcmcia/pxa2xx_stargate2.c
> index 9396222..6c2366b 100644
> --- a/drivers/pcmcia/pxa2xx_stargate2.c
> +++ b/drivers/pcmcia/pxa2xx_stargate2.c
> @@ -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));
> Â}
>
> diff --git a/drivers/pcmcia/pxa2xx_vpac270.c b/drivers/pcmcia/pxa2xx_vpac270.c
> index 66ab92c..61b17d2 100644
> --- a/drivers/pcmcia/pxa2xx_vpac270.c
> +++ b/drivers/pcmcia/pxa2xx_vpac270.c
> @@ -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);
> --
> 1.7.5.4
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/