OSDN Git Service

MIPS: BCM63xx: Move bcm63xx_gpio_init() to bcm63xx_register_devices().
authorNicolas Schichan <nschichan@freebox.fr>
Thu, 12 Mar 2015 16:00:58 +0000 (17:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 May 2015 12:14:18 +0000 (05:14 -0700)
commit195161fd176acfedad69c0d259eabe050b993902
tree03b0f7f9384369456b67acfed46ad4f7b383a58b
parent77a23cb5bdb54f462341045248a7672009050fc0
MIPS: BCM63xx: Move bcm63xx_gpio_init() to bcm63xx_register_devices().

Commit 2ec459f2a77b808c1e5a3616c88b613d3f720c8d upstream.

When called from prom init code, bcm63xx_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 bcm63xx_gpio_init() to bcm63xx_register_devices() (an
arch_initcall) where kmalloc works.

Fixes: 14e85c0e69d5 ("gpio: remove gpio_descs global array")

Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: Alexandre Courbot <acourbot@nvidia.com>
Patchwork: https://patchwork.linux-mips.org/patch/9530/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/mips/bcm63xx/prom.c
arch/mips/bcm63xx/setup.c