[PATCH] pcmcia: db1xxx_ss: fix last irq_to_gpio user

Arnd Bergmann arnd at arndb.de
Wed Mar 2 01:01:14 PST 2016


On Wednesday 02 March 2016 09:16:12 Manuel Lauss wrote:
> remove the usage of removed irq_to_gpio() function.  On pre-DB1200
> boards, pass the actual carddetect GPIO number instead of the IRQ,
> because we need the gpio to actually test card status (inserted or
> not) and can get the irq number with gpio_to_irq() instead.
> 
> Tested on DB1300 and DB1500, this patch fixes PCMCIA on the DB1500,
> which used irq_to_gpio().
> 
> Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>

Thanks for addressing this

Acked-by: Arnd Bergmann <arnd at arndb.de>

You should probably add the fixes line from my earlier patch,
and add Cc:stable so it gets backported to 4.4.

>  
> -	/* insert: irq which triggers on card insertion/ejection */
> +	/* insert: irq which triggers on card insertion/ejection
> +	 * BIG FAT NOTE: on DB1000/1100/1500/1550 we pass a GPIO here!
> +	 */
>  	r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "insert");
>  	sock->insert_irq = r ? r->start : -1;
> +	if (sock->board_type == BOARD_TYPE_DEFAULT) {
> +		sock->insert_gpio = r ? r->start : -1;
> +		sock->insert_irq = r ? gpio_to_irq(r->start) : -1;
> +	}
>  
>  	/* stschg: irq which trigger on card status change (optional) */
>  	r = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "stschg");

My first approach was to pass the gpio number as platform_data, but
that seemed to get rather complicated, so I dropped the initial
patch.

Passing it as an IORESOURCE_IRQ is a bit weird too, but I guess it
gets the job done.

	Arnd



More information about the linux-pcmcia mailing list