mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	linux-kernel@vger.kernel.org
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 4/5] w1: gpio: Remove duplicate NULL checks
Date: Thu,  7 Mar 2024 16:35:50 +0200	[thread overview]
Message-ID: <20240307143644.3787260-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240307143644.3787260-1-andriy.shevchenko@linux.intel.com>

gpiod_set_value() is NULL-aware, no need to check that in the caller.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/w1/masters/w1-gpio.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
index 3881f2eaed2f..8fd9fedd8c56 100644
--- a/drivers/w1/masters/w1-gpio.c
+++ b/drivers/w1/masters/w1-gpio.c
@@ -117,8 +117,7 @@ static int w1_gpio_probe(struct platform_device *pdev)
 	if (err)
 		return dev_err_probe(dev, err, "w1_add_master device failed\n");
 
-	if (ddata->pullup_gpiod)
-		gpiod_set_value(ddata->pullup_gpiod, 1);
+	gpiod_set_value(ddata->pullup_gpiod, 1);
 
 	platform_set_drvdata(pdev, master);
 
@@ -130,8 +129,7 @@ static void w1_gpio_remove(struct platform_device *pdev)
 	struct w1_bus_master *master = platform_get_drvdata(pdev);
 	struct w1_gpio_ddata *ddata = master->data;
 
-	if (ddata->pullup_gpiod)
-		gpiod_set_value(ddata->pullup_gpiod, 0);
+	gpiod_set_value(ddata->pullup_gpiod, 0);
 
 	w1_remove_master_device(master);
 }
-- 
2.43.0.rc1.1.gbec44491f096


  parent reply	other threads:[~2024-03-07 14:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 14:35 [PATCH v1 0/5] w1: gpio: A set of cleanups Andy Shevchenko
2024-03-07 14:35 ` [PATCH v1 1/5] w1: gpio: Make use of device properties Andy Shevchenko
2024-03-07 14:35 ` [PATCH v1 2/5] w1: gpio: Switch to use dev_err_probe() Andy Shevchenko
2024-03-07 16:40   ` Uwe Kleine-König
2024-03-07 14:35 ` [PATCH v1 3/5] w1: gpio: Use sizeof(*pointer) instead of sizeof(type) Andy Shevchenko
2024-03-07 16:41   ` Uwe Kleine-König
2024-03-07 14:35 ` Andy Shevchenko [this message]
2024-03-07 16:44   ` [PATCH v1 4/5] w1: gpio: Remove duplicate NULL checks Uwe Kleine-König
2024-03-07 14:35 ` [PATCH v1 5/5] w1: gpio: Don't use "proxy" headers Andy Shevchenko
2024-03-07 16:38 ` [PATCH v1 0/5] w1: gpio: A set of cleanups Uwe Kleine-König
2024-03-07 16:43   ` Andy Shevchenko
2024-03-07 17:12     ` Uwe Kleine-König
2024-03-07 17:57       ` Andy Shevchenko
2024-03-08  7:56         ` Uwe Kleine-König
2024-03-08  8:34   ` Krzysztof Kozlowski
2024-03-08 13:28     ` Andy Shevchenko
2024-03-25 11:08 ` Krzysztof Kozlowski

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=20240307143644.3787260-5-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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

Powered by JetHome