Skip to contentSkip to conversation

thermal: rockchip: fix an error code

PATCH In review Dan Carpenter 3 participants 4 messages Apr 21, 2015 – Apr 28, 2015 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: rockchip: fix an error code

There is a copy and paste bug, "->clk" vs "->pclk", so we return the wrong error code here.

Fixes cbac8f639437 ('thermal: rockchip: add driver for thermal')
drivers/thermal/rockchip_thermal.c +1 -1
index 3aa46ac..cd8f5f93 100644
@@ -529,7 +529,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 
 	thermal->pclk = devm_clk_get(&pdev->dev, "apb_pclk");
 	if (IS_ERR(thermal->pclk)) {
-		error = PTR_ERR(thermal->clk);
+		error = PTR_ERR(thermal->pclk);
 		dev_err(&pdev->dev, "failed to get apb_pclk clock: %d\n",
 			error);
 		return error;
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Dan Carpenter

There is a copy and paste bug, "->clk" vs "->pclk", so we return the wrong error code here.

Fixes cbac8f639437 ('thermal: rockchip: add driver for thermal')
drivers/thermal/rockchip_thermal.c +0 -0
index 3aa46ac..cd8f5f93 100644

drivers/thermal/rockchip_thermal.c static int rockchip_thermal_probe(struct platform_device *pdev) · line 532

Quoted 5 lines
drivers/thermal/rockchip_thermal.c +1 -1
@@ -529,7 +529,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 
  	thermal->pclk = devm_clk_get(&pdev->dev, "apb_pclk");
  	if (IS_ERR(thermal->pclk)) {
-		error = PTR_ERR(thermal->clk);
+		error = PTR_ERR(thermal->pclk);

Yeah, you are right.

Thanks.

Caesar

Quoted 6 lines
drivers/thermal/rockchip_thermal.c +0 -0
  		dev_err(&pdev->dev, "failed to get apb_pclk clock: %d\n",
  			error);
  		return error;
Signature · 17 lines
**************************************************************************************
王晓腾    Caesar Wang
Product R&D Dept.III
Fuzhou Rockchip Electronics Co.Ltd
Addr:  NO.18 Building, A District, Fuzhou Software Park,Gulou District,Fuzhou, Fujian,China(Fuzhou Headquarters)
               21F,Malata Building,Kejizhongyi Avenue,Nanshan District,Shenzhen  (Shenzhen Office)
Tel:+86-591-83991906/07 - 8221
Mobile:+86 15059456742
E-mail : [email protected]
***************************************************************************************
***************************************************************************************
IMPORTANT NOTICE: This email is from Fuzhou Rockchip Electronics Co., Ltd .The contents of this email and any attachments may
contain information that is privileged, confidential and/or exempt from disclosure under applicable law and relevant NDA.
If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the
information is STRICTLY PROHIBITED. Please immediately contact the sender as soon as possible and destroy the material
in its entirety in any format. Thank you.
***************************************************************************************

A message that is not in the archive (sent off-list or not yet received): [email protected]

Tested-by
#3 lore raw

Dan,

Quoted 21 lines · Caesar Wang
Quoted 12 lines · Dan Carpenter

There is a copy and paste bug, "->clk" vs "->pclk", so we return the wrong error code here.

Fixes cbac8f639437 ('thermal: rockchip: add driver for thermal')
drivers/thermal/rockchip_thermal.c +0 -0
index 3aa46ac..cd8f5f93 100644

drivers/thermal/rockchip_thermal.c static int rockchip_thermal_probe(struct · line 532

Quoted 5 lines
drivers/thermal/rockchip_thermal.c +1 -1
@@ -529,7 +529,7 @@ static int rockchip_thermal_probe(struct 
 platform_device *pdev)
        thermal->pclk = devm_clk_get(&pdev->dev, "apb_pclk");
      if (IS_ERR(thermal->pclk)) {
-        error = PTR_ERR(thermal->clk);
+        error = PTR_ERR(thermal->pclk);

Yeah, you are right.

Quoted 2 lines
Quoted 10 lines

Thanks.

Caesar

Quoted 6 lines
drivers/thermal/rockchip_thermal.c +0 -0
          dev_err(&pdev->dev, "failed to get apb_pclk clock: %d\n",
              error);
          return error;
Signature · 17 lines
**************************************************************************************
王晓腾    Caesar Wang
Product R&D Dept.III
Fuzhou Rockchip Electronics Co.Ltd
Addr:  NO.18 Building, A District, Fuzhou Software Park,Gulou District,Fuzhou, Fujian,China(Fuzhou Headquarters)
               21F,Malata Building,Kejizhongyi Avenue,Nanshan District,Shenzhen  (Shenzhen Office)
Tel:+86-591-83991906/07 - 8221
Mobile:+86 15059456742
E-mail : [email protected]
***************************************************************************************
***************************************************************************************
IMPORTANT NOTICE: This email is from Fuzhou Rockchip Electronics Co., Ltd .The contents of this email and any attachments may
contain information that is privileged, confidential and/or exempt from disclosure under applicable law and relevant NDA.
If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the
information is STRICTLY PROHIBITED. Please immediately contact the sender as soon as possible and destroy the material
in its entirety in any format. Thank you.
***************************************************************************************
Reviewed-by on v1 1/1
#4 lore raw
In reply to Dan Carpenter

Dan,

Quoted 11 lines · Dan Carpenter

There is a copy and paste bug, "->clk" vs "->pclk", so we return the wrong error code here.

Fixes cbac8f639437 ('thermal: rockchip: add driver for thermal')
drivers/thermal/rockchip_thermal.c +0 -0
index 3aa46ac..cd8f5f93 100644

drivers/thermal/rockchip_thermal.c static int rockchip_thermal_probe(struct platform_device *pdev) · line 535

Quoted 8 lines
drivers/thermal/rockchip_thermal.c +1 -1
@@ -529,7 +529,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 
        thermal->pclk = devm_clk_get(&pdev->dev, "apb_pclk");
        if (IS_ERR(thermal->pclk)) {
-               error = PTR_ERR(thermal->clk);
+               error = PTR_ERR(thermal->pclk);
                dev_err(&pdev->dev, "failed to get apb_pclk clock: %d\n",
                        error);
                return error;

Thanks! :) An obvious fix, but just in case it helps feel free to add: