Commit eecd37e1 authored by Guenter Roeck's avatar Guenter Roeck Committed by Greg Kroah-Hartman

drivers: Fix boot problem on SuperH

SuperH images crash too eearly to display any console output. Bisect
points to commit 507fd01d ("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 <brgl@bgdev.pl>
Fixes: 507fd01d ("drivers: move the early platform device support to arch/sh")
Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Acked-by: default avatarRob Landley <rob@landley.net>
Link: https://lore.kernel.org/r/20191203205852.15659-1-linux@roeck-us.netSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 51ba8b3a
...@@ -325,9 +325,9 @@ int __init sh_early_platform_driver_probe(char *class_str, ...@@ -325,9 +325,9 @@ int __init sh_early_platform_driver_probe(char *class_str,
} }
/** /**
* sh_early_platform_cleanup - clean up early platform code * early_platform_cleanup - clean up early platform code
*/ */
static int __init sh_early_platform_cleanup(void) void __init early_platform_cleanup(void)
{ {
struct platform_device *pd, *pd2; struct platform_device *pd, *pd2;
...@@ -337,11 +337,4 @@ static int __init sh_early_platform_cleanup(void) ...@@ -337,11 +337,4 @@ static int __init sh_early_platform_cleanup(void)
list_del(&pd->dev.devres_head); list_del(&pd->dev.devres_head);
memset(&pd->dev.devres_head, 0, sizeof(pd->dev.devres_head)); memset(&pd->dev.devres_head, 0, sizeof(pd->dev.devres_head));
} }
return 0;
} }
/*
* This must happen once after all early devices are probed but before probing
* real platform devices.
*/
subsys_initcall(sh_early_platform_cleanup);
...@@ -1325,10 +1325,14 @@ struct device *platform_find_device_by_driver(struct device *start, ...@@ -1325,10 +1325,14 @@ struct device *platform_find_device_by_driver(struct device *start,
} }
EXPORT_SYMBOL_GPL(platform_find_device_by_driver); EXPORT_SYMBOL_GPL(platform_find_device_by_driver);
void __weak __init early_platform_cleanup(void) { }
int __init platform_bus_init(void) int __init platform_bus_init(void)
{ {
int error; int error;
early_platform_cleanup();
error = device_register(&platform_bus); error = device_register(&platform_bus);
if (error) { if (error) {
put_device(&platform_bus); put_device(&platform_bus);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment