Message ID | 1358929554-32265-2-git-send-email-haojian.zhuang@linaro.org |
---|---|
State | Accepted |
Commit | 6c7e660a27da7494c670bfba21cfeba30457656c |
Headers | show |
On Wed, Jan 23, 2013 at 9:25 AM, Haojian Zhuang <haojian.zhuang@linaro.org> wrote: > gpio & pinctrl driver are used together. The pinctrl driver is already > launched before gpio driver in Makefile. So set gpio driver to module > init level. Otherwise, the sequence will be inverted. > > Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Applied to my devel branch. Thanks! Linus Walleij
Haojian Zhuang <haojian.zhuang@linaro.org> writes: > gpio & pinctrl driver are used together. The pinctrl driver is already > launched before gpio driver in Makefile. So set gpio driver to module > init level. Otherwise, the sequence will be inverted. Hi Haojian, If you switch gpio to module level, and as some modules use gpios in their init path, isn't it possible that some modules will fail their init, as GPIO API won't provide the gpio_*_value() functions ? Cheers. -- Robert
On 26 January 2013 05:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote: > Haojian Zhuang <haojian.zhuang@linaro.org> writes: > >> gpio & pinctrl driver are used together. The pinctrl driver is already >> launched before gpio driver in Makefile. So set gpio driver to module >> init level. Otherwise, the sequence will be inverted. > Hi Haojian, > > If you switch gpio to module level, and as some modules use gpios in their init > path, isn't it possible that some modules will fail their init, as GPIO API > won't provide the gpio_*_value() functions ? > gpio_request() should return EPROBE_DEFER, then the driver is using gpio API fails and it should be retried after a while. At that time, gpio driver should be launched properly. Regards Haojian
On Mon, Jan 28, 2013 at 5:26 AM, Haojian Zhuang <haojian.zhuang@linaro.org> wrote: > On 26 January 2013 05:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote: >> Haojian Zhuang <haojian.zhuang@linaro.org> writes: >> >>> gpio & pinctrl driver are used together. The pinctrl driver is already >>> launched before gpio driver in Makefile. So set gpio driver to module >>> init level. Otherwise, the sequence will be inverted. >> Hi Haojian, >> >> If you switch gpio to module level, and as some modules use gpios in their init >> path, isn't it possible that some modules will fail their init, as GPIO API >> won't provide the gpio_*_value() functions ? > > gpio_request() should return EPROBE_DEFER, then the driver is using gpio API > fails and it should be retried after a while. At that time, gpio > driver should be launched > properly. Correct. However it is not uncommon for modules to have untested errorpaths, such as: ret = gpio_request(12); if (ret) return -ENODEV; So you will not know before you test. Then it is often common to have memory leaks in the errorpath... So Tested-by: tags are appreciated. Yours, Linus Walleij
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index 8325f58..9cc108d 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -642,12 +642,7 @@ static struct platform_driver pxa_gpio_driver = { .of_match_table = of_match_ptr(pxa_gpio_dt_ids), }, }; - -static int __init pxa_gpio_init(void) -{ - return platform_driver_register(&pxa_gpio_driver); -} -postcore_initcall(pxa_gpio_init); +module_platform_driver(pxa_gpio_driver); #ifdef CONFIG_PM static int pxa_gpio_suspend(void)
gpio & pinctrl driver are used together. The pinctrl driver is already launched before gpio driver in Makefile. So set gpio driver to module init level. Otherwise, the sequence will be inverted. Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> --- drivers/gpio/gpio-pxa.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)