Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: mc33880: Drop if with an always false condition

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>

authored by

Uwe Kleine-König and committed by
Bartosz Golaszewski
f4a20dfa 06de2cd7

-2
-2
drivers/gpio/gpio-mc33880.c
··· 139 139 struct mc33880 *mc; 140 140 141 141 mc = spi_get_drvdata(spi); 142 - if (!mc) 143 - return -ENODEV; 144 142 145 143 gpiochip_remove(&mc->chip); 146 144 mutex_destroy(&mc->lock);