aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Kleine-König <[email protected]>2021-09-09 15:06:52 +0100
committerRussell King (Oracle) <[email protected]>2021-10-19 10:30:54 +0100
commit1c1838757611e2fd3aa798b4a9219f8777f29149 (patch)
treeb1a34343b5a1d7a9ffd1bfb7651ca21033095f78
parent854f695c3d41853eb7efcd436023c5ab92a257eb (diff)
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 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/[email protected] Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
-rw-r--r--arch/arm/common/scoop.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index 6edb961bd6c1..e74c5bfdc6d3 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -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);