gpiolib: Defer gpio device setup until after gpiolib initialization
authorGuenter Roeck <linux@roeck-us.net>
Thu, 31 Mar 2016 15:11:30 +0000 (08:11 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 8 Apr 2016 08:10:09 +0000 (10:10 +0200)
commit159f3cd92f17c61a4e2a47456de5865b114ef88e
tree4d3fc7e1a33a29249fc05749ac79f0695a3b7a8c
parent476e2fc5cd430bbe17598833e79f8e8b9e4bbbc7
gpiolib: Defer gpio device setup until after gpiolib initialization

Since commit ff2b13592299 ("gpio: make the gpiochip a real device"),
attempts to add a gpio chip prior to gpiolib initialization cause
the system to crash. This happens because gpio_bus_type has not been
registered yet. Defer creating gpio devices until after gpiolib has
been initialized to fix the problem.

Cc: Greg Ungerer <gerg@uclinux.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Fixes: ff2b13592299 ("gpio: make the gpiochip a real device")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c