diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-03-19 13:06:19 +0300 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2023-03-20 22:59:08 +0300 |
commit | 13cd9ac670df5e052d3a31ae21bb1787202870dd (patch) | |
tree | 4d0254e501c76fcef292c6d86de7d1ef948a7f68 /drivers/of | |
parent | 5cdade2d77dd41a2ed98967c3887f5d66a4d23c4 (diff) | |
download | linux-13cd9ac670df5e052d3a31ae21bb1787202870dd.tar.xz |
of: unittest: Drop if blocks with always false condition
unittest_gpio_remove() is only called after unittest_gpio_probe() completed
successfully. In this case driver data was set to a non-NULL value and so
platform_get_drvdata() never returns NULL.
Also note that the compiler might optimize away this check anyhow as
devptr was already dereferenced for the dev_dbg call above.
Drop this if block.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230319100620.295849-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/unittest.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 2504092e8302..0b0b966133b7 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -1633,9 +1633,6 @@ static int unittest_gpio_remove(struct platform_device *pdev) dev_dbg(dev, "%s for node @%pfw\n", __func__, devptr->chip.fwnode); - if (!devptr) - return -EINVAL; - if (devptr->chip.base != -1) gpiochip_remove(&devptr->chip); |