PM / devfreq: mediatek: Fix unnecessary check of drvdata
Subsystems (2)
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
@@ -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
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 whenmtk_ccifreq_targetget's called, the drv pointer will never be NULL. This fixes a static checker warning.Cc Dan Carpenter <[email protected]>Signed-off-by Matthias Brugger <[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 whenmtk_ccifreq_targetget's called, the drv pointer will never be
NULL. This fixes a static checker warning.Cc Dan Carpenter <[email protected]>Signed-off-by Matthias Brugger <[email protected]>--- 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
index71abb3fbd042..ad05b152071d100644
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