* [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource()
@ 2013-03-04 6:45 Sachin Kamat
2013-03-04 6:45 ` [PATCH 2/3] Thermal: rcar: " Sachin Kamat
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Sachin Kamat @ 2013-03-04 6:45 UTC (permalink / raw)
To: linux-pm; +Cc: rui.zhang, thierry.reding, sachin.kamat, Andrew Lunn
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Andrew Lunn <andrew@lunn.ch>
---
drivers/thermal/dove_thermal.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
index 7b0bfa0..3078c40 100644
--- a/drivers/thermal/dove_thermal.c
+++ b/drivers/thermal/dove_thermal.c
@@ -143,22 +143,18 @@ static int dove_thermal_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
- priv->sensor = devm_request_and_ioremap(&pdev->dev, res);
- if (!priv->sensor) {
- dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
- return -EADDRNOTAVAIL;
- }
+ priv->sensor = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(priv->sensor))
+ return PTR_ERR(priv->sensor);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) {
dev_err(&pdev->dev, "Failed to get platform resource\n");
return -ENODEV;
}
- priv->control = devm_request_and_ioremap(&pdev->dev, res);
- if (!priv->control) {
- dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
- return -EADDRNOTAVAIL;
- }
+ priv->control = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(priv->control))
+ return PTR_ERR(priv->control);
ret = dove_init_sensor(priv);
if (ret) {
--
1.7.4.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/3] Thermal: rcar: Convert to devm_ioremap_resource()
2013-03-04 6:45 [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource() Sachin Kamat
@ 2013-03-04 6:45 ` Sachin Kamat
2013-03-04 7:06 ` Thierry Reding
2013-03-11 14:35 ` Zhang Rui
2013-03-04 6:45 ` [PATCH 3/3] Thermal: kirkwood: " Sachin Kamat
` (2 subsequent siblings)
3 siblings, 2 replies; 11+ messages in thread
From: Sachin Kamat @ 2013-03-04 6:45 UTC (permalink / raw)
To: linux-pm; +Cc: rui.zhang, thierry.reding, sachin.kamat, Kuninori Morimoto
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
drivers/thermal/rcar_thermal.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 28f0919..b28990a 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -399,11 +399,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
/*
* rcar_has_irq_support() will be enabled
*/
- common->base = devm_request_and_ioremap(dev, res);
- if (!common->base) {
- dev_err(dev, "Unable to ioremap thermal register\n");
- return -ENOMEM;
- }
+ common->base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(common->base))
+ return PTR_ERR(common->base);
/* enable temperature comparation */
rcar_thermal_common_write(common, ENR, 0x00030303);
@@ -422,11 +420,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
return -ENOMEM;
}
- priv->base = devm_request_and_ioremap(dev, res);
- if (!priv->base) {
- dev_err(dev, "Unable to ioremap priv register\n");
- return -ENOMEM;
- }
+ priv->base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(priv->base))
+ return PTR_ERR(priv->base);
priv->common = common;
priv->id = i;
--
1.7.4.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/3] Thermal: kirkwood: Convert to devm_ioremap_resource()
2013-03-04 6:45 [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource() Sachin Kamat
2013-03-04 6:45 ` [PATCH 2/3] Thermal: rcar: " Sachin Kamat
@ 2013-03-04 6:45 ` Sachin Kamat
2013-03-04 7:06 ` Thierry Reding
2013-03-11 14:35 ` Zhang Rui
2013-03-04 7:06 ` [PATCH 1/3] Thermal: dove: " Thierry Reding
2013-03-11 14:35 ` Zhang Rui
3 siblings, 2 replies; 11+ messages in thread
From: Sachin Kamat @ 2013-03-04 6:45 UTC (permalink / raw)
To: linux-pm; +Cc: rui.zhang, thierry.reding, sachin.kamat, Nobuhiro Iwamatsu
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
drivers/thermal/kirkwood_thermal.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
index 65cb4f0..e5500ed 100644
--- a/drivers/thermal/kirkwood_thermal.c
+++ b/drivers/thermal/kirkwood_thermal.c
@@ -85,11 +85,9 @@ static int kirkwood_thermal_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
- priv->sensor = devm_request_and_ioremap(&pdev->dev, res);
- if (!priv->sensor) {
- dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
- return -EADDRNOTAVAIL;
- }
+ priv->sensor = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(priv->sensor))
+ return PTR_ERR(priv->sensor);
thermal = thermal_zone_device_register("kirkwood_thermal", 0, 0,
priv, &ops, NULL, 0, 0);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource()
2013-03-04 6:45 [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource() Sachin Kamat
2013-03-04 6:45 ` [PATCH 2/3] Thermal: rcar: " Sachin Kamat
2013-03-04 6:45 ` [PATCH 3/3] Thermal: kirkwood: " Sachin Kamat
@ 2013-03-04 7:06 ` Thierry Reding
2013-03-11 11:37 ` Sachin Kamat
2013-03-11 14:35 ` Zhang Rui
3 siblings, 1 reply; 11+ messages in thread
From: Thierry Reding @ 2013-03-04 7:06 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-pm, rui.zhang, Andrew Lunn
[-- Attachment #1: Type: text/plain, Size: 1822 bytes --]
On Mon, Mar 04, 2013 at 12:15:32PM +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
>
> devm_ioremap_resource() provides its own error messages; so all explicit
> error messages can be removed from the failure code paths.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Andrew Lunn <andrew@lunn.ch>
> ---
> drivers/thermal/dove_thermal.c | 16 ++++++----------
> 1 files changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
> index 7b0bfa0..3078c40 100644
> --- a/drivers/thermal/dove_thermal.c
> +++ b/drivers/thermal/dove_thermal.c
> @@ -143,22 +143,18 @@ static int dove_thermal_probe(struct platform_device *pdev)
> if (!priv)
> return -ENOMEM;
>
> - priv->sensor = devm_request_and_ioremap(&pdev->dev, res);
> - if (!priv->sensor) {
> - dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
> - return -EADDRNOTAVAIL;
> - }
> + priv->sensor = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(priv->sensor))
> + return PTR_ERR(priv->sensor);
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> if (!res) {
> dev_err(&pdev->dev, "Failed to get platform resource\n");
> return -ENODEV;
> }
> - priv->control = devm_request_and_ioremap(&pdev->dev, res);
> - if (!priv->control) {
> - dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
> - return -EADDRNOTAVAIL;
> - }
> + priv->control = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(priv->control))
> + return PTR_ERR(priv->control);
>
> ret = dove_init_sensor(priv);
> if (ret) {
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/3] Thermal: rcar: Convert to devm_ioremap_resource()
2013-03-04 6:45 ` [PATCH 2/3] Thermal: rcar: " Sachin Kamat
@ 2013-03-04 7:06 ` Thierry Reding
2013-03-11 14:35 ` Zhang Rui
1 sibling, 0 replies; 11+ messages in thread
From: Thierry Reding @ 2013-03-04 7:06 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-pm, rui.zhang, Kuninori Morimoto
[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]
On Mon, Mar 04, 2013 at 12:15:33PM +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
>
> devm_ioremap_resource() provides its own error messages; so all explicit
> error messages can be removed from the failure code paths.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> drivers/thermal/rcar_thermal.c | 16 ++++++----------
> 1 files changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 28f0919..b28990a 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -399,11 +399,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
> /*
> * rcar_has_irq_support() will be enabled
> */
> - common->base = devm_request_and_ioremap(dev, res);
> - if (!common->base) {
> - dev_err(dev, "Unable to ioremap thermal register\n");
> - return -ENOMEM;
> - }
> + common->base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(common->base))
> + return PTR_ERR(common->base);
>
> /* enable temperature comparation */
> rcar_thermal_common_write(common, ENR, 0x00030303);
> @@ -422,11 +420,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
> return -ENOMEM;
> }
>
> - priv->base = devm_request_and_ioremap(dev, res);
> - if (!priv->base) {
> - dev_err(dev, "Unable to ioremap priv register\n");
> - return -ENOMEM;
> - }
> + priv->base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(priv->base))
> + return PTR_ERR(priv->base);
>
> priv->common = common;
> priv->id = i;
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] Thermal: kirkwood: Convert to devm_ioremap_resource()
2013-03-04 6:45 ` [PATCH 3/3] Thermal: kirkwood: " Sachin Kamat
@ 2013-03-04 7:06 ` Thierry Reding
2013-03-04 20:16 ` Nobuhiro Iwamatsu
2013-03-11 14:35 ` Zhang Rui
1 sibling, 1 reply; 11+ messages in thread
From: Thierry Reding @ 2013-03-04 7:06 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-pm, rui.zhang, Nobuhiro Iwamatsu
[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]
On Mon, Mar 04, 2013 at 12:15:34PM +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
>
> devm_ioremap_resource() provides its own error messages; so all explicit
> error messages can be removed from the failure code paths.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
> ---
> drivers/thermal/kirkwood_thermal.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
> index 65cb4f0..e5500ed 100644
> --- a/drivers/thermal/kirkwood_thermal.c
> +++ b/drivers/thermal/kirkwood_thermal.c
> @@ -85,11 +85,9 @@ static int kirkwood_thermal_probe(struct platform_device *pdev)
> if (!priv)
> return -ENOMEM;
>
> - priv->sensor = devm_request_and_ioremap(&pdev->dev, res);
> - if (!priv->sensor) {
> - dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
> - return -EADDRNOTAVAIL;
> - }
> + priv->sensor = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(priv->sensor))
> + return PTR_ERR(priv->sensor);
>
> thermal = thermal_zone_device_register("kirkwood_thermal", 0, 0,
> priv, &ops, NULL, 0, 0);
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] Thermal: kirkwood: Convert to devm_ioremap_resource()
2013-03-04 7:06 ` Thierry Reding
@ 2013-03-04 20:16 ` Nobuhiro Iwamatsu
0 siblings, 0 replies; 11+ messages in thread
From: Nobuhiro Iwamatsu @ 2013-03-04 20:16 UTC (permalink / raw)
To: Thierry Reding; +Cc: Sachin Kamat, linux-pm, rui.zhang
On Mon, Mar 4, 2013 at 4:06 PM, Thierry Reding
<thierry.reding@avionic-design.de> wrote:
> On Mon, Mar 04, 2013 at 12:15:34PM +0530, Sachin Kamat wrote:
>> Use the newly introduced devm_ioremap_resource() instead of
>> devm_request_and_ioremap() which provides more consistent error handling.
>>
>> devm_ioremap_resource() provides its own error messages; so all explicit
>> error messages can be removed from the failure code paths.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
>> ---
>> drivers/thermal/kirkwood_thermal.c | 8 +++-----
>> 1 files changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
>> index 65cb4f0..e5500ed 100644
>> --- a/drivers/thermal/kirkwood_thermal.c
>> +++ b/drivers/thermal/kirkwood_thermal.c
>> @@ -85,11 +85,9 @@ static int kirkwood_thermal_probe(struct platform_device *pdev)
>> if (!priv)
>> return -ENOMEM;
>>
>> - priv->sensor = devm_request_and_ioremap(&pdev->dev, res);
>> - if (!priv->sensor) {
>> - dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
>> - return -EADDRNOTAVAIL;
>> - }
>> + priv->sensor = devm_ioremap_resource(&pdev->dev, res);
>> + if (IS_ERR(priv->sensor))
>> + return PTR_ERR(priv->sensor);
>>
>> thermal = thermal_zone_device_register("kirkwood_thermal", 0, 0,
>> priv, &ops, NULL, 0, 0);
>
> Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
--
Nobuhiro Iwamatsu
iwamatsu at {nigauri.org / debian.org}
GPG ID: 40AD1FA6
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource()
2013-03-04 7:06 ` [PATCH 1/3] Thermal: dove: " Thierry Reding
@ 2013-03-11 11:37 ` Sachin Kamat
0 siblings, 0 replies; 11+ messages in thread
From: Sachin Kamat @ 2013-03-11 11:37 UTC (permalink / raw)
To: Zhang Rui; +Cc: linux-pm
Hi Zhang,
On 4 March 2013 12:36, Thierry Reding <thierry.reding@avionic-design.de> wrote:
> On Mon, Mar 04, 2013 at 12:15:32PM +0530, Sachin Kamat wrote:
>> Use the newly introduced devm_ioremap_resource() instead of
>> devm_request_and_ioremap() which provides more consistent error handling.
>>
>> devm_ioremap_resource() provides its own error messages; so all explicit
>> error messages can be removed from the failure code paths.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>> Cc: Andrew Lunn <andrew@lunn.ch>
>
>
> Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Did you get a chance to review this series?
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource()
2013-03-04 6:45 [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource() Sachin Kamat
` (2 preceding siblings ...)
2013-03-04 7:06 ` [PATCH 1/3] Thermal: dove: " Thierry Reding
@ 2013-03-11 14:35 ` Zhang Rui
3 siblings, 0 replies; 11+ messages in thread
From: Zhang Rui @ 2013-03-11 14:35 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-pm, thierry.reding, Andrew Lunn
On Mon, 2013-03-04 at 12:15 +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
>
> devm_ioremap_resource() provides its own error messages; so all explicit
> error messages can be removed from the failure code paths.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Andrew Lunn <andrew@lunn.ch>
applied to thermal -next tree.
thanks,
rui
> ---
> drivers/thermal/dove_thermal.c | 16 ++++++----------
> 1 files changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
> index 7b0bfa0..3078c40 100644
> --- a/drivers/thermal/dove_thermal.c
> +++ b/drivers/thermal/dove_thermal.c
> @@ -143,22 +143,18 @@ static int dove_thermal_probe(struct platform_device *pdev)
> if (!priv)
> return -ENOMEM;
>
> - priv->sensor = devm_request_and_ioremap(&pdev->dev, res);
> - if (!priv->sensor) {
> - dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
> - return -EADDRNOTAVAIL;
> - }
> + priv->sensor = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(priv->sensor))
> + return PTR_ERR(priv->sensor);
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> if (!res) {
> dev_err(&pdev->dev, "Failed to get platform resource\n");
> return -ENODEV;
> }
> - priv->control = devm_request_and_ioremap(&pdev->dev, res);
> - if (!priv->control) {
> - dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
> - return -EADDRNOTAVAIL;
> - }
> + priv->control = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(priv->control))
> + return PTR_ERR(priv->control);
>
> ret = dove_init_sensor(priv);
> if (ret) {
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/3] Thermal: rcar: Convert to devm_ioremap_resource()
2013-03-04 6:45 ` [PATCH 2/3] Thermal: rcar: " Sachin Kamat
2013-03-04 7:06 ` Thierry Reding
@ 2013-03-11 14:35 ` Zhang Rui
1 sibling, 0 replies; 11+ messages in thread
From: Zhang Rui @ 2013-03-11 14:35 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-pm, thierry.reding, Kuninori Morimoto
On Mon, 2013-03-04 at 12:15 +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
>
> devm_ioremap_resource() provides its own error messages; so all explicit
> error messages can be removed from the failure code paths.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
applied to thermal -next tree.
thanks,
rui
> ---
> drivers/thermal/rcar_thermal.c | 16 ++++++----------
> 1 files changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 28f0919..b28990a 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -399,11 +399,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
> /*
> * rcar_has_irq_support() will be enabled
> */
> - common->base = devm_request_and_ioremap(dev, res);
> - if (!common->base) {
> - dev_err(dev, "Unable to ioremap thermal register\n");
> - return -ENOMEM;
> - }
> + common->base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(common->base))
> + return PTR_ERR(common->base);
>
> /* enable temperature comparation */
> rcar_thermal_common_write(common, ENR, 0x00030303);
> @@ -422,11 +420,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
> return -ENOMEM;
> }
>
> - priv->base = devm_request_and_ioremap(dev, res);
> - if (!priv->base) {
> - dev_err(dev, "Unable to ioremap priv register\n");
> - return -ENOMEM;
> - }
> + priv->base = devm_ioremap_resource(dev, res);
> + if (IS_ERR(priv->base))
> + return PTR_ERR(priv->base);
>
> priv->common = common;
> priv->id = i;
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 3/3] Thermal: kirkwood: Convert to devm_ioremap_resource()
2013-03-04 6:45 ` [PATCH 3/3] Thermal: kirkwood: " Sachin Kamat
2013-03-04 7:06 ` Thierry Reding
@ 2013-03-11 14:35 ` Zhang Rui
1 sibling, 0 replies; 11+ messages in thread
From: Zhang Rui @ 2013-03-11 14:35 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-pm, thierry.reding, Nobuhiro Iwamatsu
On Mon, 2013-03-04 at 12:15 +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
>
> devm_ioremap_resource() provides its own error messages; so all explicit
> error messages can be removed from the failure code paths.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
applied to thermal -next tree.
thanks,
rui
> ---
> drivers/thermal/kirkwood_thermal.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
> index 65cb4f0..e5500ed 100644
> --- a/drivers/thermal/kirkwood_thermal.c
> +++ b/drivers/thermal/kirkwood_thermal.c
> @@ -85,11 +85,9 @@ static int kirkwood_thermal_probe(struct platform_device *pdev)
> if (!priv)
> return -ENOMEM;
>
> - priv->sensor = devm_request_and_ioremap(&pdev->dev, res);
> - if (!priv->sensor) {
> - dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
> - return -EADDRNOTAVAIL;
> - }
> + priv->sensor = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(priv->sensor))
> + return PTR_ERR(priv->sensor);
>
> thermal = thermal_zone_device_register("kirkwood_thermal", 0, 0,
> priv, &ops, NULL, 0, 0);
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-03-11 14:35 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-04 6:45 [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource() Sachin Kamat
2013-03-04 6:45 ` [PATCH 2/3] Thermal: rcar: " Sachin Kamat
2013-03-04 7:06 ` Thierry Reding
2013-03-11 14:35 ` Zhang Rui
2013-03-04 6:45 ` [PATCH 3/3] Thermal: kirkwood: " Sachin Kamat
2013-03-04 7:06 ` Thierry Reding
2013-03-04 20:16 ` Nobuhiro Iwamatsu
2013-03-11 14:35 ` Zhang Rui
2013-03-04 7:06 ` [PATCH 1/3] Thermal: dove: " Thierry Reding
2013-03-11 11:37 ` Sachin Kamat
2013-03-11 14:35 ` Zhang Rui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).