cpufreq: airoha: fix probe failure with correct error check
Subsystems (2)
PATCH 1/1 cpufreq: airoha: fix probe failure with correct error check
From: Daniel Schwierzeck <[email protected]>
dev_pm_domain_attach_list() returns the number of attached PM domains on success (a positive count), or a negative error code on failure. The driver checks "if (ret)" which treats a successful attachment of one or more PM domains as an error, causing the probe to fail with return code 1.
Fix by checking "if (ret < 0)" like all other users of this API.
--- drivers/cpufreq/airoha-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/airoha-cpufreq.c +1 -1
@@ -64,7 +64,7 @@ static int airoha_cpufreq_probe(struct platform_device *pdev)/* Attach PM for OPP */ ret =dev_pm_domain_attach_list (cpu_dev, &attach_data, &priv->pd_list); -if (ret) +if (ret <0 ) goto clear_opp_config; cpufreq_dt =platform_device_register_simple ("cpufreq-dt" ,-1 ,NULL ,0 );
Signature · 1 line
2.53.0
Quoted 8 lines · Christian Marangi
From: Daniel Schwierzeck <[email protected]>
dev_pm_domain_attach_list()returns the number of attached PM domains on success (a positive count), or a negative error code on failure. The driver checks "if (ret)" which treats a successful attachment of one or more PM domains as an error, causing the probe to fail with return code 1.
Quoted 6 lines
Fix by checking "if (ret < 0)" like all other users of this API.
Fixes 84cf9e541ccc ("cpufreq: airoha: Add EN7581 CPUFreq SMCCC driver")Signed-off-by Daniel Schwierzeck <[email protected]>Signed-off-by Christian Marangi <[email protected]>
Quoted 17 lines
--- drivers/cpufreq/airoha-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/cpufreq/airoha-cpufreq.c +1
-1@@ -64,7 +64,7 @@ static int airoha_cpufreq_probe(struct platform_device *pdev)/* Attach PM for OPP */ ret =dev_pm_domain_attach_list (cpu_dev, &attach_data, &priv->pd_list); -if (ret) +if (ret <0 ) goto clear_opp_config; cpufreq_dt =platform_device_register_simple ("cpufreq-dt" ,-1 ,NULL ,0 );
Signature · 2 lines
Thx and BRs, Zhongqiu Han
Quoted 10 lines · Christian Marangi
From: Daniel Schwierzeck <[email protected]>
dev_pm_domain_attach_list()returns the number of attached PM domains on success (a positive count), or a negative error code on failure. The driver checks "if (ret)" which treats a successful attachment of one or more PM domains as an error, causing the probe to fail with return code 1.Fix by checking "if (ret < 0)" like all other users of this API.
Quoted 7 lines
Fixes 84cf9e541ccc ("cpufreq: airoha: Add EN7581 CPUFreq SMCCC driver")Signed-off-by Daniel Schwierzeck <[email protected]>Signed-off-by Christian Marangi <[email protected]>--- drivers/cpufreq/airoha-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied. Thanks.
Signature · 1 line
viresh