ARM: 9123/1: scoop: Drop if with an always false condition
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 9 Sep 2021 14:06:52 +0000 (15:06 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 19 Oct 2021 09:30:54 +0000 (10:30 +0100)
The remove callback is only called after probe completed successfully.
In this case platform_set_drvdata() was called with a non-NULL argument
and so !sdev is never true.

The motivation for this change is to get rid of non-zero return values
for remove callbacks as their only effect is to trigger a runtime
warning. See commit e5e1c2097881 ("driver core: platform: Emit a warning
if a remove callback returned non-zero") for further details.

Link: https://lore.kernel.org/linux-arm-kernel/20210721205450.2173923-1-u.kleine-koenig@pengutronix.de
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
arch/arm/common/scoop.c

index 6edb961bd6c1d246872d227585a84c6af02df389..e74c5bfdc6d311414370b5afe4f381b9d2f99755 100644 (file)
@@ -240,9 +240,6 @@ static int scoop_remove(struct platform_device *pdev)
 {
        struct scoop_dev *sdev = platform_get_drvdata(pdev);
 
-       if (!sdev)
-               return -EINVAL;
-
        if (sdev->gpio.base != -1)
                gpiochip_remove(&sdev->gpio);