[PATCH 03/30] clk: xilinx: Drop if block with always false condition

Uwe Kleine-König posted 30 patches 1 year, 8 months ago
[PATCH 03/30] clk: xilinx: Drop if block with always false condition
Posted by Uwe Kleine-König 1 year, 8 months ago
xvcu_remove() is only called for a device after after xvcu_probe()
completed successfully. In that case dev_set_drvdata() was called for
that device with a non-NULL parameter, so platform_get_drvdata() won't
return NULL and the if condition is never true.

Drop the if, preparing a conversion to make platform driver's remove
callback return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/clk/xilinx/xlnx_vcu.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c
index d66b1315114e..54b44debfd3e 100644
--- a/drivers/clk/xilinx/xlnx_vcu.c
+++ b/drivers/clk/xilinx/xlnx_vcu.c
@@ -707,8 +707,6 @@ static int xvcu_remove(struct platform_device *pdev)
 	struct xvcu_device *xvcu;
 
 	xvcu = platform_get_drvdata(pdev);
-	if (!xvcu)
-		return -ENODEV;
 
 	xvcu_unregister_clock_provider(xvcu);
 
-- 
2.39.1

Re: [PATCH 03/30] clk: xilinx: Drop if block with always false condition
Posted by Stephen Boyd 1 year, 7 months ago
Quoting Uwe Kleine-König (2023-03-12 09:14:45)
> xvcu_remove() is only called for a device after after xvcu_probe()
> completed successfully. In that case dev_set_drvdata() was called for
> that device with a non-NULL parameter, so platform_get_drvdata() won't
> return NULL and the if condition is never true.
> 
> Drop the if, preparing a conversion to make platform driver's remove
> callback return void.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---

Applied to clk-next