leds: verify vendor and change license in mlxcpld driver
authorVadim Pasternak <vadimp@mellanox.com>
Thu, 3 Nov 2016 19:17:19 +0000 (19:17 +0000)
committerJacek Anaszewski <j.anaszewski@samsung.com>
Tue, 22 Nov 2016 11:07:04 +0000 (12:07 +0100)
Verify that vendor is Mellanox as the first step of initialization.
If it is not - return ENODEV.
Change module license from "GPL v2" to "Dual BSD/GPL".

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
drivers/leds/leds-mlxcpld.c

index 197ab9b29a9c435790815c99a804fcbf75f98e8e..281482e1d50fc2eec96c25ae8b570da03e38c22f 100644 (file)
@@ -400,6 +400,9 @@ static int __init mlxcpld_led_init(void)
        struct platform_device *pdev;
        int err;
 
+       if (!dmi_match(DMI_CHASSIS_VENDOR, "Mellanox Technologies Ltd."))
+               return -ENODEV;
+
        pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
        if (IS_ERR(pdev)) {
                pr_err("Device allocation failed\n");
@@ -426,5 +429,5 @@ module_exit(mlxcpld_led_exit);
 
 MODULE_AUTHOR("Vadim Pasternak <vadimp@mellanox.com>");
 MODULE_DESCRIPTION("Mellanox board LED driver");
-MODULE_LICENSE("GPL v2");
+MODULE_LICENSE("Dual BSD/GPL");
 MODULE_ALIAS("platform:leds_mlxcpld");