From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Johannes Berg <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>
Cc: Chen-Yu Tsai <wens@csie.org>, Rhyland Klein <rklein@nvidia.com>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>
Subject: [PATCH 2/4] net: rfkill: gpio: remove gpio names
Date: Thu, 20 Feb 2014 14:51:35 +0200 [thread overview]
Message-ID: <1392900697-27577-3-git-send-email-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <1392900697-27577-1-git-send-email-heikki.krogerus@linux.intel.com>
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 <dan.carpenter@oracle.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
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
next prev parent reply other threads:[~2014-02-20 12:51 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-20 12:51 [PATCH 0/4] net: rfkill: gpio: clean up and a few new acpi ids Heikki Krogerus
2014-02-20 12:51 ` [PATCH 1/4] net: rfkill: gpio: remove unused and obsolete platform parameters Heikki Krogerus
2014-02-21 13:55 ` Marc Dietrich
2014-02-21 14:23 ` Heikki Krogerus
2014-02-22 22:32 ` [PATCH 1/4] net: rfkill: gpio: remove unused and obsoleteplatform parameters Marc Dietrich
2014-02-24 8:38 ` Heikki Krogerus
2014-02-24 8:42 ` [PATCH 1/4] net: rfkill: gpio: remove unused andobsoleteplatform parameters Marc Dietrich
2014-02-20 12:51 ` Heikki Krogerus [this message]
2014-02-20 16:38 ` [PATCH 2/4] net: rfkill: gpio: remove gpio names Stephen Warren
2014-02-21 1:55 ` Chen-Yu Tsai
[not found] ` <CAGb2v66-tDZhrm9dnXe+PdQTaLZbw20sw3uYzLor2eXpVWmPMA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-02-21 5:35 ` Stephen Warren
2014-02-25 9:13 ` Linus Walleij
2014-02-25 17:35 ` Stephen Warren
[not found] ` <530CD45A.8050803-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-03-07 2:51 ` Linus Walleij
2014-02-27 17:38 ` Gross, Mark
2014-02-27 17:47 ` Stephen Warren
2014-02-27 20:06 ` mark gross
2014-03-07 2:58 ` Linus Walleij
2014-02-20 12:51 ` [PATCH 3/4] net: rfkill: gpio: add ACPI ID for GPS module on Lenove Miix2 Heikki Krogerus
2014-02-20 12:51 ` [PATCH 4/4] net: rfkill: gpio: add ACPI IDs for a Broadcom bluetooth chip Heikki Krogerus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1392900697-27577-3-git-send-email-heikki.krogerus@linux.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=gnurou@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rklein@nvidia.com \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).