x86/platform/goldfish: Prevent unconditional loading
[firefly-linux-kernel-4.4.55.git] / arch / x86 / platform / goldfish / goldfish.c
index 1693107a518e7560f774df657bcc464296e6f45f..0d17c0aafeb142310152b802a18b969c52bd89f9 100644 (file)
@@ -42,10 +42,22 @@ static struct resource goldfish_pdev_bus_resources[] = {
        }
 };
 
+static bool goldfish_enable __initdata;
+
+static int __init goldfish_setup(char *str)
+{
+       goldfish_enable = true;
+       return 0;
+}
+__setup("goldfish", goldfish_setup);
+
 static int __init goldfish_init(void)
 {
+       if (!goldfish_enable)
+               return -ENODEV;
+
        platform_device_register_simple("goldfish_pdev_bus", -1,
-                                               goldfish_pdev_bus_resources, 2);
+                                       goldfish_pdev_bus_resources, 2);
        return 0;
 }
 device_initcall(goldfish_init);