[PATCH -next] CPUFREQ: Loongson1: Fix return value check in ls1x_cpufreq_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>

In case of error, the function clk_get_parent() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
---
 drivers/cpufreq/loongson1-cpufreq.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/cpufreq/loongson1-cpufreq.c b/drivers/cpufreq/loongson1-cpufreq.c
index be89416..b3a62d0 100644
--- a/drivers/cpufreq/loongson1-cpufreq.c
+++ b/drivers/cpufreq/loongson1-cpufreq.c
@@ -162,18 +162,18 @@ static int ls1x_cpufreq_probe(struct platform_device *pdev)
 	cpufreq->clk = clk;
 
 	clk = clk_get_parent(clk);
-	if (IS_ERR(clk)) {
+	if (!clk) {
 		dev_err(&pdev->dev, "unable to get parent of %s clock\n",
 			__clk_get_name(cpufreq->clk));
-		return PTR_ERR(clk);
+		return -ENODEV;
 	}
 	cpufreq->mux_clk = clk;
 
 	clk = clk_get_parent(clk);
-	if (IS_ERR(clk)) {
+	if (!clk) {
 		dev_err(&pdev->dev, "unable to get parent of %s clock\n",
 			__clk_get_name(cpufreq->mux_clk));
-		return PTR_ERR(clk);
+		return -ENODEV;
 	}
 	cpufreq->pll_clk = clk;






[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux