From c1b8ac969febc8f413c4d71f0eefe2e107610449 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 17 Jun 2021 11:51:40 +0200 Subject: [PATCH] pwm: tegra: Drop an if block with an always false condition MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit tegra_pwm_remove() is only called after tegra_pwm_probe() successfully completed. In this case platform_set_drvdata() was called with a non-NULL value and so platform_get_drvdata(pdev) cannot return NULL. Returning an error code from a platform_driver's remove function is ignored anyway, so it's a good thing this exit path is gone. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding --- drivers/pwm/pwm-tegra.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c index c529a17..fa02579 100644 --- a/drivers/pwm/pwm-tegra.c +++ b/drivers/pwm/pwm-tegra.c @@ -303,9 +303,6 @@ static int tegra_pwm_remove(struct platform_device *pdev) unsigned int i; int err; - if (WARN_ON(!pc)) - return -ENODEV; - err = clk_prepare_enable(pc->clk); if (err < 0) return err; -- 2.7.4