Commit 1c183875 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Russell King (Oracle)

ARM: 9123/1: scoop: Drop if with an always false condition

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 e5e1c209 ("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.deReviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
parent 854f695c
...@@ -240,9 +240,6 @@ static int scoop_remove(struct platform_device *pdev) ...@@ -240,9 +240,6 @@ static int scoop_remove(struct platform_device *pdev)
{ {
struct scoop_dev *sdev = platform_get_drvdata(pdev); struct scoop_dev *sdev = platform_get_drvdata(pdev);
if (!sdev)
return -EINVAL;
if (sdev->gpio.base != -1) if (sdev->gpio.base != -1)
gpiochip_remove(&sdev->gpio); gpiochip_remove(&sdev->gpio);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment