diff options
author | Jonas Gorski <jonas.gorski@gmail.com> | 2017-10-29 16:27:19 +0100 |
---|---|---|
committer | James Hogan <jhogan@kernel.org> | 2017-11-08 12:44:26 +0000 |
commit | e6b03ab63b4d270e0249f96536fde632409dc1dc (patch) | |
tree | 25e5e31c20e38bab9fdb7e50e04055396f42a5b9 /arch/mips/ar7/prom.c | |
parent | ea4b3afe1eac8f88bb453798a084fba47a1f155a (diff) | |
download | op-kernel-dev-e6b03ab63b4d270e0249f96536fde632409dc1dc.zip op-kernel-dev-e6b03ab63b4d270e0249f96536fde632409dc1dc.tar.gz |
MIPS: AR7: Defer registration of GPIO
When called from prom init code, ar7_gpio_init() will fail as it will
call gpiochip_add() which relies on a working kmalloc() to alloc
the gpio_desc array and kmalloc is not useable yet at prom init time.
Move ar7_gpio_init() to ar7_register_devices() (a device_initcall)
where kmalloc works.
Fixes: 14e85c0e69d5 ("gpio: remove gpio_descs global array")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
Cc: Nicolas Schichan <nschichan@freebox.fr>
Cc: linux-mips@linux-mips.org
Cc: linux-serial@vger.kernel.org
Cc: <stable@vger.kernel.org> # 3.19+
Patchwork: https://patchwork.linux-mips.org/patch/17542/
Signed-off-by: James Hogan <jhogan@kernel.org>
Diffstat (limited to 'arch/mips/ar7/prom.c')
-rw-r--r-- | arch/mips/ar7/prom.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c index 4fd8333..dd53987 100644 --- a/arch/mips/ar7/prom.c +++ b/arch/mips/ar7/prom.c @@ -246,8 +246,6 @@ void __init prom_init(void) ar7_init_cmdline(fw_arg0, (char **)fw_arg1); ar7_init_env((struct env_var *)fw_arg2); console_config(); - - ar7_gpio_init(); } #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4))) |