Skip to contentSkip to conversation

PM / devfreq: mediatek: Fix unnecessary check of drvdata

PATCH In review [email protected] 3 participants 3 messages Jun 20, 2022 – Jun 21, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM / devfreq: mediatek: Fix unnecessary check of drvdata

From: Matthias Brugger <[email protected]>

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.

---
 drivers/devfreq/mtk-cci-devfreq.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/devfreq/mtk-cci-devfreq.c +0 -3
index 71abb3fbd042..ad05b152071d 100644
@@ -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;
 
Signature · 1 line
2.36.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Il 20/06/22 17:43, [email protected] ha scritto:

Quoted 8 lines

From: Matthias Brugger <[email protected]>

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.

Tested-by on v1 1/1
#2 lore raw
In reply to [email protected]
Quoted 20 lines · On Mon, 2022-06-20 at 17:43 +0200, [email protected] wrote:

From: Matthias Brugger <[email protected]>

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.

---
 drivers/devfreq/mtk-cci-devfreq.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/devfreq/mtk- renamed from drivers/devfreq/mtk-cci-devfreq.c +0 -0

cci-devfreq.c
index 71abb3fbd042..ad05b152071d 100644

drivers/devfreq/mtk-cci-devfreq.c static int mtk_ccifreq_target(struct device *dev, · line 137

Quoted 9 lines
drivers/devfreq/mtk-cci-devfreq.c +0 -3
@@ -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;

Hi Matthias,

Thank you for improving this driver.
I've tested this patch on the MT8183 and MT8186 platforms.

BRs,
Johnson Wang