Skip to contentSkip to conversation

thermal: solve compilation errors in rcar_thermal

PATCH In review Devendra Naga 4 participants 11 messages Aug 21, 2012 – Nov 7, 2012

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

PATCH 1/1 thermal: solve compilation errors in rcar_thermal

following were the errors reported

drivers/thermal/rcar_thermal.c: In function ‘rcar_thermal_probe’:
drivers/thermal/rcar_thermal.c:214:10: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default] include/linux/thermal.h:166:29: note: expected ‘int’ but argument is of type ‘struct rcar_thermal_priv *’ drivers/thermal/rcar_thermal.c:214:10: error: too few arguments to function ‘thermal_zone_device_register’ include/linux/thermal.h:166:29: note: declared here
make[1]: *** [drivers/thermal/rcar_thermal.o] Error 1
make: *** [drivers/thermal/rcar_thermal.o] Error 2

with gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

---
 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/rcar_thermal.c +1 -1
index d445271..f7a1b57 100644
@@ -210,7 +210,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		goto error_free_priv;
 	}
 
-	zone = thermal_zone_device_register("rcar_thermal", 0, priv,
+	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
 					    &rcar_thermal_zone_ops, 0, 0);
 	if (IS_ERR(zone)) {
 		dev_err(&pdev->dev, "thermal zone device is NULL\n");
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw

Hi

Quoted 10 lines

following were the errors reported

drivers/thermal/rcar_thermal.c: In function ‘rcar_thermal_probe’:
drivers/thermal/rcar_thermal.c:214:10: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default] include/linux/thermal.h:166:29: note: expected ‘int’ but argument is of type ‘struct rcar_thermal_priv *’ drivers/thermal/rcar_thermal.c:214:10: error: too few arguments to function ‘thermal_zone_device_register’ include/linux/thermal.h:166:29: note: declared here
make[1]: *** [drivers/thermal/rcar_thermal.o] Error 1
make: *** [drivers/thermal/rcar_thermal.o] Error 2

Quoted 4 lines

with gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

---

Best regards
---
Kuninori Morimoto

#2 lore raw

PATCH 1/1 thermal: rcar_thermal: remove explicitly used devm_kfree/iounap()

In reply to Devendra Naga

devm_kfree and devm_iounmap should not have to be explicitly used

---
This patch is based on Devendra's
[PATCH] thermal: solve compilation errors in rcar_thermal

 drivers/thermal/rcar_thermal.c |   18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
drivers/thermal/rcar_thermal.c +2 -16
index 762f637..81dce23 100644
@@ -185,7 +185,6 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 	struct thermal_zone_device *zone;
 	struct rcar_thermal_priv *priv;
 	struct resource *res;
-	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
@@ -206,16 +205,14 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 					  res->start, resource_size(res));
 	if (!priv->base) {
 		dev_err(&pdev->dev, "Unable to ioremap thermal register\n");
-		ret = -ENOMEM;
-		goto error_free_priv;
+		return -ENOMEM;
 	}
 
 	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
 				    &rcar_thermal_zone_ops, NULL, 0, 0);
 	if (IS_ERR(zone)) {
 		dev_err(&pdev->dev, "thermal zone device is NULL\n");
-		ret = PTR_ERR(zone);
-		goto error_iounmap;
+		return PTR_ERR(zone);
 	}
 
 	platform_set_drvdata(pdev, zone);
@@ -223,26 +220,15 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "proved\n");
 
 	return 0;
-
-error_iounmap:
-	devm_iounmap(&pdev->dev, priv->base);
-error_free_priv:
-	devm_kfree(&pdev->dev, priv);
-
-	return ret;
 }
 
 static int rcar_thermal_remove(struct platform_device *pdev)
 {
 	struct thermal_zone_device *zone = platform_get_drvdata(pdev);
-	struct rcar_thermal_priv *priv = zone->devdata;
 
 	thermal_zone_device_unregister(zone);
 	platform_set_drvdata(pdev, NULL);
 
-	devm_iounmap(&pdev->dev, priv->base);
-	devm_kfree(&pdev->dev, priv);
-
 	return 0;
 }
 
Signature · 1 line
1.7.9.5
reviewer Applied
#3 lore raw

Re: [PATCH] thermal: rcar_thermal: remove explicitly used devm_kfree/iounap()

Quoted 3 lines · Kuninori Morimoto

devm_kfree and devm_iounmap should not have to be explicitly used

applied to thermal-next.

thanks,
rui

Quoted 65 lines

---
This patch is based on Devendra's
[PATCH] thermal: solve compilation errors in rcar_thermal

 drivers/thermal/rcar_thermal.c |   18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
drivers/thermal/rcar_thermal.c +2 -16
index 762f637..81dce23 100644
@@ -185,7 +185,6 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 	struct thermal_zone_device *zone;
 	struct rcar_thermal_priv *priv;
 	struct resource *res;
-	int ret;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
@@ -206,16 +205,14 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 					  res->start, resource_size(res));
 	if (!priv->base) {
 		dev_err(&pdev->dev, "Unable to ioremap thermal register\n");
-		ret = -ENOMEM;
-		goto error_free_priv;
+		return -ENOMEM;
 	}
 
 	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
 				    &rcar_thermal_zone_ops, NULL, 0, 0);
 	if (IS_ERR(zone)) {
 		dev_err(&pdev->dev, "thermal zone device is NULL\n");
-		ret = PTR_ERR(zone);
-		goto error_iounmap;
+		return PTR_ERR(zone);
 	}
 
 	platform_set_drvdata(pdev, zone);
@@ -223,26 +220,15 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "proved\n");
 
 	return 0;
-
-error_iounmap:
-	devm_iounmap(&pdev->dev, priv->base);
-error_free_priv:
-	devm_kfree(&pdev->dev, priv);
-
-	return ret;
 }
 
 static int rcar_thermal_remove(struct platform_device *pdev)
 {
 	struct thermal_zone_device *zone = platform_get_drvdata(pdev);
-	struct rcar_thermal_priv *priv = zone->devdata;
 
 	thermal_zone_device_unregister(zone);
 	platform_set_drvdata(pdev, NULL);
 
-	devm_iounmap(&pdev->dev, priv->base);
-	devm_kfree(&pdev->dev, priv);
-
 	return 0;
 }
 
#4 lore raw

PATCH 1/1 thermal: rcar: fixup compilation errors

In reply to Devendra Naga

This patch fixup following error

${LINUX}/drivers/thermal/rcar_thermal.c: In function 'rcar_thermal_probe':

${LINUX}/drivers/thermal/rcar_thermal.c:214:9: warning: passing argument 3 \
	of 'thermal_zone_device_register' makes integer from pointer without\
	a cast [enabled by default]

${LINUX}/include/linux/thermal.h:215:29: note: expected 'int' but argument \
is of type 'struct rcar_thermal_priv *'
${LINUX}/drivers/thermal/rcar_thermal.c:214:9:\
error: too few arguments to function 'thermal_zone_device_register'

---
for linus/master branch

 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/rcar_thermal.c +1 -1
index b13fe5d..762f637 100644
@@ -210,7 +210,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		goto error_free_priv;
 	}
 
-	zone = thermal_zone_device_register("rcar_thermal", 0, priv,
+	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
 				    &rcar_thermal_zone_ops, NULL, 0, 0);
 	if (IS_ERR(zone)) {
 		dev_err(&pdev->dev, "thermal zone device is NULL\n");
Signature · 1 line
1.7.9.5
reviewer
#5 lore raw

Re: [PATCH] thermal: rcar: fixup compilation errors

Quoted 6 lines · Kuninori Morimoto

This patch fixup following error

${LINUX}/drivers/thermal/rcar_thermal.c: In function 'rcar_thermal_probe':

${LINUX}/drivers/thermal/rcar_thermal.c:214:9: warning: passing argument 3 \
	of 'thermal_zone_device_register' makes integer from pointer without\
	a cast [enabled by default]
Quoted 7 lines

${LINUX}/include/linux/thermal.h:215:29: note: expected 'int' but argument \
is of type 'struct rcar_thermal_priv *'
${LINUX}/drivers/thermal/rcar_thermal.c:214:9:\
error: too few arguments to function 'thermal_zone_device_register'

shipped in 3.7-rc4.

thanks,
rui

Quoted 19 lines

---
for linus/master branch

 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/rcar_thermal.c +1 -1
index b13fe5d..762f637 100644
@@ -210,7 +210,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		goto error_free_priv;
 	}
 
-	zone = thermal_zone_device_register("rcar_thermal", 0, priv,
+	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
 				    &rcar_thermal_zone_ops, NULL, 0, 0);
 	if (IS_ERR(zone)) {
 		dev_err(&pdev->dev, "thermal zone device is NULL\n");
#6 lore raw
In reply to Devendra Naga

Hi Zhang, Andrew

This patch is needed on latest linus/master branch. Please re-check this patch.

And, similar patch was added on linux-next/master branch b5da4e6d5603633835a1da267e0e699eea66f317
(Thermal: Pass zone parameters as argument to tzd_register) but it seems wrong (?)

At Tue, 21 Aug 2012 22:01:36 +0530,

Quoted 34 lines · Devendra Naga

following were the errors reported

drivers/thermal/rcar_thermal.c: In function ‘rcar_thermal_probe’:
drivers/thermal/rcar_thermal.c:214:10: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default] include/linux/thermal.h:166:29: note: expected ‘int’ but argument is of type ‘struct rcar_thermal_priv *’ drivers/thermal/rcar_thermal.c:214:10: error: too few arguments to function ‘thermal_zone_device_register’ include/linux/thermal.h:166:29: note: declared here
make[1]: *** [drivers/thermal/rcar_thermal.o] Error 1
make: *** [drivers/thermal/rcar_thermal.o] Error 2

with gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

---
 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/rcar_thermal.c +1 -1
index d445271..f7a1b57 100644
@@ -210,7 +210,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		goto error_free_priv;
 	}
 
-	zone = thermal_zone_device_register("rcar_thermal", 0, priv,
+	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
 					    &rcar_thermal_zone_ops, 0, 0);
 	if (IS_ERR(zone)) {
 		dev_err(&pdev->dev, "thermal zone device is NULL\n");
Signature · 1 line
1.7.9.5

Best regards
---
Kuninori Morimoto

reviewer
#7 lore raw

Sorry, I can not see the original post of this patch.

Can you resend it so that I can apply it?

Quoted 66 lines

-----Original Message-----
From: kuninori morimoto [mailto:[email protected]] On Behalf Of Kuninori Morimoto
Sent: Wednesday, October 31, 2012 11:21 AM
To: Andrew Morton; Zhang, Rui; [email protected]
Cc: Wu, Fengguang
Subject: Re: [PATCH] thermal: solve compilation errors in rcar_thermal
Importance: High

Hi Zhang, Andrew

This patch is needed on latest linus/master branch. Please re-check this patch.

And, similar patch was added on linux-next/master branch b5da4e6d5603633835a1da267e0e699eea66f317
(Thermal: Pass zone parameters as argument to tzd_register) but it seems wrong (?)

At Tue, 21 Aug 2012 22:01:36 +0530,

Quoted 8 lines · Devendra Naga

following were the errors reported

drivers/thermal/rcar_thermal.c: In function 'rcar_thermal_probe':
drivers/thermal/rcar_thermal.c:214:10: warning: passing argument 3 of 'thermal_zone_device_register' makes integer from pointer without a cast [enabled by default]
include/linux/thermal.h:166:29: note: expected 'int' but argument is

of type 'struct rcar_thermal_priv *'

Quoted 1 line

drivers/thermal/rcar_thermal.c:214:10: error: too few arguments to

function 'thermal_zone_device_register'

drivers/thermal/rcar_thermal.c static int rcar_thermal_probe(struct

Quoted 16 lines

include/linux/thermal.h:166:29: note: declared here make[1]: *** [drivers/thermal/rcar_thermal.o] Error 1
make: *** [drivers/thermal/rcar_thermal.o] Error 2

with gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

---
 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/thermal/rcar_thermal.c index d445271..f7a1b57 100644

drivers/thermal/rcar_thermal.c +0 -0
@@ -210,7 +210,7 @@ static int rcar_thermal_probe(struct

platform_device *pdev)

Quoted 11 lines
drivers/thermal/rcar_thermal.c +1 -2
 		goto error_free_priv;
 	}
 
-	zone = thermal_zone_device_register("rcar_thermal", 0, priv,
+	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
 					    &rcar_thermal_zone_ops, 0, 0);
 	if (IS_ERR(zone)) {
 		dev_err(&pdev->dev, "thermal zone device is NULL\n");
--

1.7.9.5

Best regards
---
Kuninori Morimoto

#8 lore raw

PATCH 1/1 thermal: solve compilation errors in rcar_thermal

From: Devendra Naga <[email protected]>

following were the errors reported

drivers/thermal/rcar_thermal.c: In function ‘rcar_thermal_probe’:
drivers/thermal/rcar_thermal.c:214:10: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default] include/linux/thermal.h:166:29: note: expected ‘int’ but argument is of type ‘struct rcar_thermal_priv *’ drivers/thermal/rcar_thermal.c:214:10: error: too few arguments to function ‘thermal_zone_device_register’ include/linux/thermal.h:166:29: note: declared here
make[1]: *** [drivers/thermal/rcar_thermal.o] Error 1
make: *** [drivers/thermal/rcar_thermal.o] Error 2

with gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

---
Hi Zhang

This is original patch.
Please check Author's name after "git am"

 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/rcar_thermal.c +1 -1
index d445271..f7a1b57 100644
@@ -210,7 +210,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		goto error_free_priv;
 	}
 
-	zone = thermal_zone_device_register("rcar_thermal", 0, priv,
+	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
 					    &rcar_thermal_zone_ops, 0, 0);
 	if (IS_ERR(zone)) {
 		dev_err(&pdev->dev, "thermal zone device is NULL\n");
Signature · 1 line
1.7.9.5
reviewer Acked-by on v1 1/1
#9 lore raw

Hi, Andrew,

Can you take this patch?
It fixes a real build error, and IMO, we should merge it ASAP. Thanks.

Quoted 26 lines

-----Original Message-----
From: kuninori morimoto [mailto:[email protected]] On Behalf Of Kuninori Morimoto
Sent: Wednesday, October 31, 2012 4:46 PM
To: Zhang, Rui
Cc: Andrew Morton; [email protected]; Wu, Fengguang; Devendra Naga
Subject: [PATCH] thermal: solve compilation errors in rcar_thermal
Importance: High

From: Devendra Naga <[email protected]>

following were the errors reported

drivers/thermal/rcar_thermal.c: In function 'rcar_thermal_probe':
drivers/thermal/rcar_thermal.c:214:10: warning: passing argument 3 of 'thermal_zone_device_register' makes integer from pointer without a cast [enabled by default]
include/linux/thermal.h:166:29: note: expected 'int' but argument is of type 'struct rcar_thermal_priv *' drivers/thermal/rcar_thermal.c:214:10: error: too few arguments to function 'thermal_zone_device_register' include/linux/thermal.h:166:29: note: declared here
make[1]: *** [drivers/thermal/rcar_thermal.o] Error 1
make: *** [drivers/thermal/rcar_thermal.o] Error 2

Quoted 3 lines

with gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

Thanks,
rui

Quoted 25 lines

---
Hi Zhang

This is original patch.
Please check Author's name after "git am"

 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/thermal/rcar_thermal.c index d445271..f7a1b57 100644

drivers/thermal/rcar_thermal.c +1 -1
@@ -210,7 +210,7 @@ static int rcar_thermal_probe(struct
 platform_device *pdev)
 		goto error_free_priv;
 	}
 
-	zone = thermal_zone_device_register("rcar_thermal", 0, priv,
+	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
 					    &rcar_thermal_zone_ops, 0, 0);
 	if (IS_ERR(zone)) {

dev_err(&pdev->dev, "thermal zone device is NULL\n");
--
1.7.9.5

#10 lore raw
In reply to Kuninori Morimoto
Quoted 5 lines · Kuninori Morimoto

Hi Zhang, Andrew

This patch is needed on latest linus/master branch. Please re-check this patch.

Rui, it'd be better to send Andrew a finalized patch with your Acked-by or Signed-off-by (because you passed it on), after resolving the below puzzle:

Quoted 4 lines

And, similar patch was added on linux-next/master branch b5da4e6d5603633835a1da267e0e699eea66f317
(Thermal: Pass zone parameters as argument to tzd_register) but it seems wrong (?)

Thanks,
Fengguang

Quoted 41 lines

At Tue, 21 Aug 2012 22:01:36 +0530,

Quoted 34 lines · Devendra Naga

following were the errors reported

drivers/thermal/rcar_thermal.c: In function ‘rcar_thermal_probe’:
drivers/thermal/rcar_thermal.c:214:10: warning: passing argument 3 of ‘thermal_zone_device_register’ makes integer from pointer without a cast [enabled by default] include/linux/thermal.h:166:29: note: expected ‘int’ but argument is of type ‘struct rcar_thermal_priv *’ drivers/thermal/rcar_thermal.c:214:10: error: too few arguments to function ‘thermal_zone_device_register’ include/linux/thermal.h:166:29: note: declared here
make[1]: *** [drivers/thermal/rcar_thermal.o] Error 1
make: *** [drivers/thermal/rcar_thermal.o] Error 2

with gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

---
 drivers/thermal/rcar_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/rcar_thermal.c +1 -1
index d445271..f7a1b57 100644
@@ -210,7 +210,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 		goto error_free_priv;
 	}
 
-	zone = thermal_zone_device_register("rcar_thermal", 0, priv,
+	zone = thermal_zone_device_register("rcar_thermal", 0, 0, priv,
 					    &rcar_thermal_zone_ops, 0, 0);
 	if (IS_ERR(zone)) {
 		dev_err(&pdev->dev, "thermal zone device is NULL\n");
Signature · 1 line
1.7.9.5

Best regards
---
Kuninori Morimoto