1

w1: gpio: Remove duplicate NULL checks

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20240307143644.3787260-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
This commit is contained in:
Andy Shevchenko 2024-03-07 16:35:50 +02:00 committed by Krzysztof Kozlowski
parent ef2b810e11
commit 540d3f15c0

View File

@ -117,7 +117,6 @@ static int w1_gpio_probe(struct platform_device *pdev)
if (err) if (err)
return dev_err_probe(dev, err, "w1_add_master device failed\n"); 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); platform_set_drvdata(pdev, master);
@ -130,7 +129,6 @@ static void w1_gpio_remove(struct platform_device *pdev)
struct w1_bus_master *master = platform_get_drvdata(pdev); struct w1_bus_master *master = platform_get_drvdata(pdev);
struct w1_gpio_ddata *ddata = master->data; 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); w1_remove_master_device(master);