[PATCH 1/6] arm: sa1100: h3100: refactor LCD GPIO handling

Linus Walleij linus.walleij at linaro.org
Tue Nov 26 03:52:19 EST 2013


On Thu, Nov 21, 2013 at 4:40 PM, Dmitry Eremin-Solenikov
<dbaryshkov at gmail.com> wrote:

> +static bool h3100_lcd_request(void)
> +{
> +       static bool h3100_lcd_ok;
> +       int rc;
> +
> +       if (h3100_lcd_ok)
> +               return true;
> +
> +       rc = gpio_request_array(h3100_lcd_gpio, ARRAY_SIZE(h3100_lcd_gpio));
> +       if (rc)
> +               pr_err("%s: can't request GPIOs\n", __func__);
> +       else
> +               h3100_lcd_ok = true;
> +
> +       return h3100_lcd_ok;
> +}

Hm hm this design pattern is somewhat strange, a run-once
construct, but OK then.
Acked-by: Linus Walleij <linus.walleij at linaro.org>

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list