MIPS: TXx9: tx49xx: Move GPIO setup from .mem_setup() to .arch_init()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Sun, 11 Sep 2016 08:48:33 +0000 (10:48 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 4 Oct 2016 14:13:57 +0000 (16:13 +0200)
commit5ac676ade1eac27fb311f0f2fb11eeac5089a66c
treeedf1b400f6ed5fca1af2187dcdd8e69612a6ed8d
parent561eca4990557b684605090fe6a2f50cecec34e1
MIPS: TXx9: tx49xx: Move GPIO setup from .mem_setup() to .arch_init()

txx9_gpio_init() calls gpiochip_add_data(), which fails with -ENOMEM as
it is called too early in the boot process. This causes all subsequent
GPIO operations to fail silently (before commit 54d77198fdfbc4f0 ("gpio:
bail out silently on NULL descriptors") it printed the error message
"gpiod_direction_output_raw: invalid GPIO" on RBTX49[23]7).

Postpone all GPIO setup to .arch_init() time to fix this.

Suggested-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-mips@linux-mips.org
Cc: linux-gpio@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14237/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/txx9/generic/setup_tx4927.c
arch/mips/txx9/generic/setup_tx4938.c
arch/mips/txx9/rbtx4927/setup.c
arch/mips/txx9/rbtx4938/setup.c