]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: AR7: Defer registration of GPIO
authorJonas Gorski <jonas.gorski@gmail.com>
Sun, 29 Oct 2017 15:27:19 +0000 (16:27 +0100)
committerJames Hogan <jhogan@kernel.org>
Wed, 8 Nov 2017 12:44:26 +0000 (12:44 +0000)
commit909db5b1af06de8a8bc27f7754bb2250255aaa91
tree25e5e31c20e38bab9fdb7e50e04055396f42a5b9
parentb5ef190d42e01a7aac9def9baed13e3af972c3a2
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: 2e6e89fb4f0e ("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>
arch/mips/ar7/platform.c
arch/mips/ar7/prom.c