Re: [PATCH v3 3/3] gpio: pxa: request pinmux function for gpio

From: Linus Walleij
Date: Sun Jan 01 2012 - 09:22:08 EST


On Thu, Dec 22, 2011 at 9:17 AM, Haojian Zhuang
<haojian.zhuang@xxxxxxxxxxx> wrote:

> While gpio is requested for pxa, gpio driver will request function ready
> on pin.
(...)

> +#ifdef CONFIG_PINMUX
> +static int pxa_gpio_request(struct gpio_chip *chip, unsigned offset)
> +{
> +       return pinmux_request_gpio(chip->base + offset);
> +}
> +
> +static void pxa_gpio_free(struct gpio_chip *chip, unsigned offset)
> +{
> +       pinmux_free_gpio(chip->base + offset);
> +}
> +#else
> +static int pxa_gpio_request(struct gpio_chip *chip, unsigned offset) {return 0;}
> +static void pxa_gpio_free(struct gpio_chip *chip, unsigned offset) {}
> +#endif
> +

Skip the #ifdef, the pinmux portion of pinctrl already provides stubs if
CONFIG_PINMUX is not selected. See <linux/pinctrl/pinmux.h>

Yours,
Linus Walleij
--
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/