Skip to content

Commit eecd37e

Browse files
groeckgregkh
authored andcommitted
drivers: Fix boot problem on SuperH
SuperH images crash too eearly to display any console output. Bisect points to commit 507fd01 ("drivers: move the early platform device support to arch/sh"). An analysis of that patch suggests that early_platform_cleanup() is now called at the wrong time. Restoring its call point fixes the problem. Cc: Bartosz Golaszewski <[email protected]> Fixes: 507fd01 ("drivers: move the early platform device support to arch/sh") Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Rob Landley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 51ba8b3 commit eecd37e

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

arch/sh/drivers/platform_early.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ int __init sh_early_platform_driver_probe(char *class_str,
325325
}
326326

327327
/**
328-
* sh_early_platform_cleanup - clean up early platform code
328+
* early_platform_cleanup - clean up early platform code
329329
*/
330-
static int __init sh_early_platform_cleanup(void)
330+
void __init early_platform_cleanup(void)
331331
{
332332
struct platform_device *pd, *pd2;
333333

@@ -337,11 +337,4 @@ static int __init sh_early_platform_cleanup(void)
337337
list_del(&pd->dev.devres_head);
338338
memset(&pd->dev.devres_head, 0, sizeof(pd->dev.devres_head));
339339
}
340-
341-
return 0;
342340
}
343-
/*
344-
* This must happen once after all early devices are probed but before probing
345-
* real platform devices.
346-
*/
347-
subsys_initcall(sh_early_platform_cleanup);

drivers/base/platform.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,10 +1325,14 @@ struct device *platform_find_device_by_driver(struct device *start,
13251325
}
13261326
EXPORT_SYMBOL_GPL(platform_find_device_by_driver);
13271327

1328+
void __weak __init early_platform_cleanup(void) { }
1329+
13281330
int __init platform_bus_init(void)
13291331
{
13301332
int error;
13311333

1334+
early_platform_cleanup();
1335+
13321336
error = device_register(&platform_bus);
13331337
if (error) {
13341338
put_device(&platform_bus);

0 commit comments

Comments
 (0)