diff options
author | Vadim Pasternak <vadimp@mellanox.com> | 2016-11-03 15:17:19 -0400 |
---|---|---|
committer | Jacek Anaszewski <j.anaszewski@samsung.com> | 2016-11-22 06:07:04 -0500 |
commit | dca897e28f364724e42f65cf0262fa367512498d (patch) | |
tree | 022cbbdf1164f1b0f68d80f96c3c2eb0c0d8e4a4 /drivers/leds | |
parent | a8c170b015ff6695641bdfbdb74729411ba1e9e5 (diff) |
leds: verify vendor and change license in mlxcpld driver
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>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-mlxcpld.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/leds/leds-mlxcpld.c b/drivers/leds/leds-mlxcpld.c index 197ab9b29a9c..281482e1d50f 100644 --- a/drivers/leds/leds-mlxcpld.c +++ b/drivers/leds/leds-mlxcpld.c | |||
@@ -400,6 +400,9 @@ static int __init mlxcpld_led_init(void) | |||
400 | struct platform_device *pdev; | 400 | struct platform_device *pdev; |
401 | int err; | 401 | int err; |
402 | 402 | ||
403 | if (!dmi_match(DMI_CHASSIS_VENDOR, "Mellanox Technologies Ltd.")) | ||
404 | return -ENODEV; | ||
405 | |||
403 | pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0); | 406 | pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0); |
404 | if (IS_ERR(pdev)) { | 407 | if (IS_ERR(pdev)) { |
405 | pr_err("Device allocation failed\n"); | 408 | pr_err("Device allocation failed\n"); |
@@ -426,5 +429,5 @@ module_exit(mlxcpld_led_exit); | |||
426 | 429 | ||
427 | MODULE_AUTHOR("Vadim Pasternak <vadimp@mellanox.com>"); | 430 | MODULE_AUTHOR("Vadim Pasternak <vadimp@mellanox.com>"); |
428 | MODULE_DESCRIPTION("Mellanox board LED driver"); | 431 | MODULE_DESCRIPTION("Mellanox board LED driver"); |
429 | MODULE_LICENSE("GPL v2"); | 432 | MODULE_LICENSE("Dual BSD/GPL"); |
430 | MODULE_ALIAS("platform:leds_mlxcpld"); | 433 | MODULE_ALIAS("platform:leds_mlxcpld"); |