Thread (4 messages) flat view 4 messages, 2 authors, 2021-06-22
STALE1896d

[PATCH 1/2] pwm: vt8500: Drop if with an always false condition

From: Uwe Kleine-König <hidden>
Date: 2021-06-21 13:07:11
Also in: linux-pwm
Subsystem: arm/vt8500 arm architecture, pwm subsystem, the rest · Maintainers: Alexey Charkov, Krzysztof Kozlowski, Uwe Kleine-König, Linus Torvalds

vt8500_pwm_remove() is only called after vt8500_pwm_probe() returned
successfully. In this case driver data was set to a non-NULL value
and so chip can never be NULL.

While touching this code also put declaration and assignment in a single
line.

Signed-off-by: Uwe Kleine-König <redacted>
---
 drivers/pwm/pwm-vt8500.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/pwm/pwm-vt8500.c b/drivers/pwm/pwm-vt8500.c
index f9eb36be9088..7164df2fbacf 100644
--- a/drivers/pwm/pwm-vt8500.c
+++ b/drivers/pwm/pwm-vt8500.c
@@ -238,11 +238,8 @@ static int vt8500_pwm_probe(struct platform_device *pdev)
 
 static int vt8500_pwm_remove(struct platform_device *pdev)
 {
-	struct vt8500_chip *chip;
+	struct vt8500_chip *chip = platform_get_drvdata(pdev);
 
-	chip = platform_get_drvdata(pdev);
-	if (chip == NULL)
-		return -ENODEV;
 
 	clk_unprepare(chip->clk);
 
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help