[PATCH] PM / devfreq: mediatek: Fix unnecessary check of drvdata

Johnson Wang johnson.wang at mediatek.com
Tue Jun 21 01:26:35 PDT 2022


On Mon, 2022-06-20 at 17:43 +0200, matthias.bgg at kernel.org wrote:
> From: Matthias Brugger <matthias.bgg at 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 at oracle.com>
> Signed-off-by: Matthias Brugger <matthias.bgg at 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;
>  

Hi Matthias,

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

Tested-by: Johnson Wang <johnson.wang at mediatek.com>

BRs,
Johnson Wang




More information about the Linux-mediatek mailing list