Skip to content

Commit 2ec459f

Browse files
nschichanralfbaechle
authored andcommitted
MIPS: BCM63xx: Move bcm63xx_gpio_init() to bcm63xx_register_devices().
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: 14e85c0 ("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>
1 parent c5b3678 commit 2ec459f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/mips/bcm63xx/prom.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <bcm63xx_cpu.h>
1818
#include <bcm63xx_io.h>
1919
#include <bcm63xx_regs.h>
20-
#include <bcm63xx_gpio.h>
2120

2221
void __init prom_init(void)
2322
{
@@ -53,9 +52,6 @@ void __init prom_init(void)
5352
reg &= ~mask;
5453
bcm_perf_writel(reg, PERF_CKCTL_REG);
5554

56-
/* register gpiochip */
57-
bcm63xx_gpio_init();
58-
5955
/* do low level board init */
6056
board_prom_init();
6157

arch/mips/bcm63xx/setup.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <bcm63xx_cpu.h>
2121
#include <bcm63xx_regs.h>
2222
#include <bcm63xx_io.h>
23+
#include <bcm63xx_gpio.h>
2324

2425
void bcm63xx_machine_halt(void)
2526
{
@@ -160,6 +161,9 @@ void __init plat_mem_setup(void)
160161

161162
int __init bcm63xx_register_devices(void)
162163
{
164+
/* register gpiochip */
165+
bcm63xx_gpio_init();
166+
163167
return board_register_devices();
164168
}
165169

0 commit comments

Comments
 (0)