Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] PM / devfreq: mediatek: Fix unnecessary check of drvdata
@ 2022-06-20 15:43 matthias.bgg
  2022-06-21  7:31 ` AngeloGioacchino Del Regno
  2022-06-21  8:26 ` Johnson Wang
  0 siblings, 2 replies; 3+ messages in thread
From: matthias.bgg @ 2022-06-20 15:43 UTC (permalink / raw)
  To: dan.carpenter, johnson.wang
  Cc: linux-pm, linux-mediatek, angelogioacchino.delregno,
	Matthias Brugger

From: Matthias Brugger <matthias.bgg@gmail.com>

Probe function will error out if drvdata 'mtk_ccifreq_drv' is null.
So when mtk_ccifreq_target get's called, the drv pointer will never be
NULL. This fixes a static checker warning.

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
---
 drivers/devfreq/mtk-cci-devfreq.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/devfreq/mtk-cci-devfreq.c b/drivers/devfreq/mtk-cci-devfreq.c
index 71abb3fbd042..ad05b152071d 100644
--- a/drivers/devfreq/mtk-cci-devfreq.c
+++ b/drivers/devfreq/mtk-cci-devfreq.c
@@ -132,9 +132,6 @@ static int mtk_ccifreq_target(struct device *dev, unsigned long *freq,
 	unsigned long opp_rate;
 	int voltage, pre_voltage, inter_voltage, target_voltage, ret;
 
-	if (!drv)
-		return -EINVAL;
-
 	if (drv->pre_freq == *freq)
 		return 0;
 
-- 
2.36.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-21  8:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-20 15:43 [PATCH] PM / devfreq: mediatek: Fix unnecessary check of drvdata matthias.bgg
2022-06-21  7:31 ` AngeloGioacchino Del Regno
2022-06-21  8:26 ` Johnson Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox