[PATCH] i2c: s3c2410: check for NULL pinctrl handle

Linus Walleij linus.walleij at linaro.org
Sat Feb 23 19:47:49 EST 2013


On Sun, Feb 24, 2013 at 1:38 AM, Tomasz Figa <tomasz.figa at gmail.com> wrote:

> The driver must know whether pin control is available, because it has to
> fall back to legacy GPIO-based pin configuration if it is not. This means
> that we must either check for NULL (which probably is not right, since
> returned handle is considered to be opaque) or pin control core must
> return an error code specific to this situation, e.g. -ENODEV.

OK so pass a flag like a bool in your platform data from the
machine like go into <linux/platform_data/i2c-s3c2410.h>
and add:

struct s3c2410_platform_i2c {
        bool  use_that_old_gpio_interface;
        (...)
};

Instead of trying to semi-guess if the pinctrl framework is there?

Surely you know this when setting up the pdata from your machine?

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list