* [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
* Re: [PATCH] PM / devfreq: mediatek: Fix unnecessary check of drvdata
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
1 sibling, 0 replies; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-06-21 7:31 UTC (permalink / raw)
To: matthias.bgg, dan.carpenter, johnson.wang
Cc: linux-pm, linux-mediatek, Matthias Brugger
Il 20/06/22 17:43, matthias.bgg@kernel.org ha scritto:
> 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>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PM / devfreq: mediatek: Fix unnecessary check of drvdata
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
1 sibling, 0 replies; 3+ messages in thread
From: Johnson Wang @ 2022-06-21 8:26 UTC (permalink / raw)
To: matthias.bgg, dan.carpenter
Cc: linux-pm, linux-mediatek, angelogioacchino.delregno, Matthias Brugger
On Mon, 2022-06-20 at 17:43 +0200, matthias.bgg@kernel.org wrote:
> 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;
>
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@mediatek.com>
BRs,
Johnson Wang
^ permalink raw reply [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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.