gpio: zynq: Do PM initialization earlier to support gpio hogs
authorMichal Simek <michal.simek@xilinx.com>
Thu, 10 Dec 2015 11:10:12 +0000 (12:10 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 14 Dec 2015 13:10:04 +0000 (14:10 +0100)
commit3773c195d3874d38d1c5ac68868024b32a1f08c9
tree5c33a6f016c3094361210d9862f41a1324507074
parent29ab875b7b4892af1a6cd0084faed37245b8dd2c
gpio: zynq: Do PM initialization earlier to support gpio hogs

GPIO hogs registration is call at the end of gpiochip_add() function.
Calling sequence is:
gpiochip_add -> of_gpiochip_add -> of_gpiochip_scan_hogs ->
gpiod_hog -> gpiochip_request_own_desc -> __gpiod_request ->
chip->request -> zynq_gpio_request which calls pm_runtime_get_sync()
which returns -13 because PM is not initialized yet.

Initialize PM before gpiochip_add is called to fix this issue.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-zynq.c