Return-path: Received: from mga14.intel.com ([143.182.124.37]:35456 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753151AbaBYMWu (ORCPT ); Tue, 25 Feb 2014 07:22:50 -0500 From: Heikki Krogerus To: Johannes Berg , "David S. Miller" Cc: Chen-Yu Tsai , Rhyland Klein , Marc Dietrich , Stephen Warren , Linus Walleij , Arnd Bergmann , Alexandre Courbot , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: [PATCHv2 3/5] net: rfkill: gpio: remove gpio names Date: Tue, 25 Feb 2014 14:22:28 +0200 Message-Id: <1393330950-7283-4-git-send-email-heikki.krogerus@linux.intel.com> (sfid-20140225_132358_929853_56B3A40E) In-Reply-To: <1393330950-7283-1-git-send-email-heikki.krogerus@linux.intel.com> References: <1393330950-7283-1-git-send-email-heikki.krogerus@linux.intel.com> Sender: linux-wireless-owner@vger.kernel.org List-ID: There is no use for them in this driver. This will fix a static checker warning.. net/rfkill/rfkill-gpio.c:144 rfkill_gpio_probe() warn: variable dereferenced before check 'rfkill->name' This will also make sure that when DT support is added, "gpios" property can be used as no con_id labels are provided. Reported-by: Dan Carpenter Signed-off-by: Heikki Krogerus --- net/rfkill/rfkill-gpio.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 0adda44..ad5e354 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -36,8 +36,6 @@ struct rfkill_gpio_data { struct gpio_desc *shutdown_gpio; struct rfkill *rfkill_dev; - char *reset_name; - char *shutdown_name; struct clk *clk; bool clk_enabled; @@ -89,7 +87,6 @@ static int rfkill_gpio_probe(struct platform_device *pdev) struct rfkill_gpio_data *rfkill; struct gpio_desc *gpio; int ret; - int len; rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL); if (!rfkill) @@ -106,21 +103,9 @@ static int rfkill_gpio_probe(struct platform_device *pdev) return -ENODEV; } - len = strlen(rfkill->name); - rfkill->reset_name = devm_kzalloc(&pdev->dev, len + 7, GFP_KERNEL); - if (!rfkill->reset_name) - return -ENOMEM; - - rfkill->shutdown_name = devm_kzalloc(&pdev->dev, len + 10, GFP_KERNEL); - if (!rfkill->shutdown_name) - return -ENOMEM; - - snprintf(rfkill->reset_name, len + 6 , "%s_reset", rfkill->name); - snprintf(rfkill->shutdown_name, len + 9, "%s_shutdown", rfkill->name); - rfkill->clk = devm_clk_get(&pdev->dev, NULL); - gpio = devm_gpiod_get_index(&pdev->dev, rfkill->reset_name, 0); + gpio = devm_gpiod_get_index(&pdev->dev, NULL, 0); if (!IS_ERR(gpio)) { ret = gpiod_direction_output(gpio, 0); if (ret) @@ -128,7 +113,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev) rfkill->reset_gpio = gpio; } - gpio = devm_gpiod_get_index(&pdev->dev, rfkill->shutdown_name, 1); + gpio = devm_gpiod_get_index(&pdev->dev, NULL, 1); if (!IS_ERR(gpio)) { ret = gpiod_direction_output(gpio, 0); if (ret) -- 1.9.0.rc3