powerpc/gamecube|wii : Use machine_device_initcall()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Sat, 18 Feb 2023 09:15:48 +0000 (10:15 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 15 Mar 2023 21:56:48 +0000 (08:56 +1100)
Instead of checking machine type in the function,
use machine_device_initcall().

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/6cb9865d916231c38401ba34ad1a98c249fae135.1676711562.git.christophe.leroy@csgroup.eu
arch/powerpc/platforms/embedded6xx/gamecube.c
arch/powerpc/platforms/embedded6xx/wii.c

index 4fc84ff..60cdc28 100644 (file)
@@ -83,11 +83,8 @@ static const struct of_device_id gamecube_of_bus[] = {
 
 static int __init gamecube_device_probe(void)
 {
-       if (!machine_is(gamecube))
-               return 0;
-
        of_platform_bus_probe(NULL, gamecube_of_bus, NULL);
        return 0;
 }
-device_initcall(gamecube_device_probe);
+machine_device_initcall(gamecube, gamecube_device_probe);
 
index f2cc00e..635c393 100644 (file)
@@ -161,13 +161,10 @@ static const struct of_device_id wii_of_bus[] = {
 
 static int __init wii_device_probe(void)
 {
-       if (!machine_is(wii))
-               return 0;
-
        of_platform_populate(NULL, wii_of_bus, NULL, NULL);
        return 0;
 }
-device_initcall(wii_device_probe);
+machine_device_initcall(wii, wii_device_probe);
 
 define_machine(wii) {
        .name                   = "wii",