gpio: mc33880: Drop if with an always false condition
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tue, 12 Oct 2021 15:39:28 +0000 (17:39 +0200)
committerBartosz Golaszewski <brgl@bgdev.pl>
Wed, 13 Oct 2021 17:52:41 +0000 (19:52 +0200)
An spi remove callback is only called for devices that probed
successfully. In this case this implies that mc33880_probe() set a
non-NULL driver data. So the check for mc being NULL is never true and
the check can be dropped.

Also the return value ofspi remove callbacks is ignored anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
drivers/gpio/gpio-mc33880.c

index f8194f7c61862c6d006210068a02c3962cdcf1e3..31d2be1bebc84e40efdda24ad8cc3d52e868f861 100644 (file)
@@ -139,8 +139,6 @@ static int mc33880_remove(struct spi_device *spi)
        struct mc33880 *mc;
 
        mc = spi_get_drvdata(spi);
-       if (!mc)
-               return -ENODEV;
 
        gpiochip_remove(&mc->chip);
        mutex_destroy(&mc->lock);