From: Varka Bhadram <varkabhadram@gmail.com>
To: linux-gpio@vger.kernel.org
Cc: linus.walleij@linaro.org, gnurou@gmail.com,
Varka Bhadram <varkab@cdac.in>
Subject: [PATCH gpio 4/4] drivers: gpio: use (!foo) instead of (foo == NULL)
Date: Tue, 31 Mar 2015 09:49:11 +0530 [thread overview]
Message-ID: <1427775551-6908-5-git-send-email-varkab@cdac.in> (raw)
In-Reply-To: <1427775551-6908-1-git-send-email-varkab@cdac.in>
Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
drivers/gpio/gpio-adp5588.c | 4 ++--
drivers/gpio/gpio-arizona.c | 2 +-
drivers/gpio/gpio-da9052.c | 2 +-
drivers/gpio/gpio-da9055.c | 2 +-
drivers/gpio/gpio-kempld.c | 2 +-
drivers/gpio/gpio-mc33880.c | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c
index 0de8c70..c90273d 100644
--- a/drivers/gpio/gpio-adp5588.c
+++ b/drivers/gpio/gpio-adp5588.c
@@ -367,7 +367,7 @@ static int adp5588_gpio_probe(struct i2c_client *client,
struct gpio_chip *gc;
int ret, i, revid;
- if (pdata == NULL) {
+ if (!pdata) {
dev_err(&client->dev, "missing platform data\n");
return -ENODEV;
}
@@ -379,7 +379,7 @@ static int adp5588_gpio_probe(struct i2c_client *client,
}
dev = devm_kzalloc(&client->dev, sizeof(*dev), GFP_KERNEL);
- if (dev == NULL)
+ if (!dev)
return -ENOMEM;
dev->client = client;
diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index ab35038..eb5a0ce 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -103,7 +103,7 @@ static int arizona_gpio_probe(struct platform_device *pdev)
arizona_gpio = devm_kzalloc(&pdev->dev, sizeof(*arizona_gpio),
GFP_KERNEL);
- if (arizona_gpio == NULL)
+ if (!arizona_gpio)
return -ENOMEM;
arizona_gpio->arizona = arizona;
diff --git a/drivers/gpio/gpio-da9052.c b/drivers/gpio/gpio-da9052.c
index 389a4d2..2e9578e 100644
--- a/drivers/gpio/gpio-da9052.c
+++ b/drivers/gpio/gpio-da9052.c
@@ -212,7 +212,7 @@ static int da9052_gpio_probe(struct platform_device *pdev)
int ret;
gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
- if (gpio == NULL)
+ if (!gpio)
return -ENOMEM;
gpio->da9052 = dev_get_drvdata(pdev->dev.parent);
diff --git a/drivers/gpio/gpio-da9055.c b/drivers/gpio/gpio-da9055.c
index b8d7570..7227e6e 100644
--- a/drivers/gpio/gpio-da9055.c
+++ b/drivers/gpio/gpio-da9055.c
@@ -146,7 +146,7 @@ static int da9055_gpio_probe(struct platform_device *pdev)
int ret;
gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
- if (gpio == NULL)
+ if (!gpio)
return -ENOMEM;
gpio->da9055 = dev_get_drvdata(pdev->dev.parent);
diff --git a/drivers/gpio/gpio-kempld.c b/drivers/gpio/gpio-kempld.c
index 443518f..6b8115f 100644
--- a/drivers/gpio/gpio-kempld.c
+++ b/drivers/gpio/gpio-kempld.c
@@ -156,7 +156,7 @@ static int kempld_gpio_probe(struct platform_device *pdev)
}
gpio = devm_kzalloc(dev, sizeof(*gpio), GFP_KERNEL);
- if (gpio == NULL)
+ if (!gpio)
return -ENOMEM;
gpio->pld = pld;
diff --git a/drivers/gpio/gpio-mc33880.c b/drivers/gpio/gpio-mc33880.c
index 4e3e160..a431604 100644
--- a/drivers/gpio/gpio-mc33880.c
+++ b/drivers/gpio/gpio-mc33880.c
@@ -151,7 +151,7 @@ static int mc33880_remove(struct spi_device *spi)
struct mc33880 *mc;
mc = spi_get_drvdata(spi);
- if (mc == NULL)
+ if (!mc)
return -ENODEV;
gpiochip_remove(&mc->chip);
--
1.7.9.5
next prev parent reply other threads:[~2015-03-31 4:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-31 4:19 [PATCH gpio 0/4] cleanup for gpio drivers Varka Bhadram
2015-03-31 4:19 ` [PATCH gpio 1/4] drivers: gpio: use devm_kzalloc Varka Bhadram
2015-04-07 14:19 ` Linus Walleij
2015-04-07 15:40 ` Johan Hovold
2015-04-07 15:37 ` Johan Hovold
2015-03-31 4:19 ` [PATCH gpio 2/4] gpio-max7300: remove 'ret' variable Varka Bhadram
2015-04-07 14:20 ` Linus Walleij
2015-03-31 4:19 ` [PATCH gpio 3/4] gpio-arizona: drop owner assignment from platform_drivers Varka Bhadram
2015-04-07 14:21 ` Linus Walleij
2015-03-31 4:19 ` Varka Bhadram [this message]
2015-04-07 14:22 ` [PATCH gpio 4/4] drivers: gpio: use (!foo) instead of (foo == NULL) Linus Walleij
2015-04-08 1:50 ` Alexandre Courbot
2015-04-08 14:56 ` Linus Walleij
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=1427775551-6908-5-git-send-email-varkab@cdac.in \
--to=varkabhadram@gmail.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=varkab@cdac.in \
/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).