Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759310AbcKCRSw (ORCPT ); Thu, 3 Nov 2016 13:18:52 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:57037 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759256AbcKCRSu (ORCPT ); Thu, 3 Nov 2016 13:18:50 -0400 From: Vadim Pasternak To: rpurdie@rpsys.net, j.anaszewski@samsung.com Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, jiri@resnulli.us, Vadim Pasternak Subject: [patch v1 1/1] leds: verify vendor and change license in mlxcpld driver Date: Thu, 3 Nov 2016 19:17:19 +0000 Message-Id: <1478200639-190079-1-git-send-email-vadimp@mellanox.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1067 Lines: 32 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 --- drivers/leds/leds-mlxcpld.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-mlxcpld.c b/drivers/leds/leds-mlxcpld.c index 197ab9b..281482e 100644 --- a/drivers/leds/leds-mlxcpld.c +++ b/drivers/leds/leds-mlxcpld.c @@ -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 "); MODULE_DESCRIPTION("Mellanox board LED driver"); -MODULE_LICENSE("GPL v2"); +MODULE_LICENSE("Dual BSD/GPL"); MODULE_ALIAS("platform:leds_mlxcpld"); -- 2.1.4