diff mbox

[v2,05/14] thermal: mvebu: Convert to devm_ioremap_resource()

Message ID 1363991114-4225-6-git-send-email-ezequiel.garcia@free-electrons.com (mailing list archive)
State Rejected
Delegated to: Zhang Rui
Headers show

Commit Message

Ezequiel Garcia March 22, 2013, 10:25 p.m. UTC
Convert devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
 drivers/thermal/mvebu_thermal.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

Comments

Eduardo Valentin April 11, 2013, 4:35 p.m. UTC | #1
Rui,

On 22-03-2013 18:25, Ezequiel Garcia wrote:
> Convert devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.
>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
>

This patch looks correct to me too.

Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>

> ---
> drivers/thermal/mvebu_thermal.c |    8 +++-----
>   1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/thermal/mvebu_thermal.c b/drivers/thermal/mvebu_thermal.c
> index 1f502ed..2aeaf75 100644
> --- a/drivers/thermal/mvebu_thermal.c
> +++ b/drivers/thermal/mvebu_thermal.c
> @@ -86,11 +86,9 @@ static int mvebu_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("mvebu_thermal", 0, 0,
>   					       priv, &ops, NULL, 0, 0);
>

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eduardo Valentin April 11, 2013, 6:55 p.m. UTC | #2
Ezequiel,

On 11-04-2013 12:35, Eduardo Valentin wrote:
> Rui,
>
> On 22-03-2013 18:25, Ezequiel Garcia wrote:
>> Convert devm_request_and_ioremap() to the newly introduced
>> devm_ioremap_resource() which provides more consistent error handling.
>>
>> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
>>
>
> This patch looks correct to me too.
>
> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
>


I know you have discarded the idea of merging the driver into a single 
driver, but can you please resend this patch on top of 
drivers/thermal/kirkwood_thermal.c file. This change still applies.

>> ---
>> drivers/thermal/mvebu_thermal.c |    8 +++-----
>>   1 files changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/thermal/mvebu_thermal.c
>> b/drivers/thermal/mvebu_thermal.c
>> index 1f502ed..2aeaf75 100644
>> --- a/drivers/thermal/mvebu_thermal.c
>> +++ b/drivers/thermal/mvebu_thermal.c
>> @@ -86,11 +86,9 @@ static int mvebu_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("mvebu_thermal", 0, 0,
>>                              priv, &ops, NULL, 0, 0);
>>
>
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/thermal/mvebu_thermal.c b/drivers/thermal/mvebu_thermal.c
index 1f502ed..2aeaf75 100644
--- a/drivers/thermal/mvebu_thermal.c
+++ b/drivers/thermal/mvebu_thermal.c
@@ -86,11 +86,9 @@  static int mvebu_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("mvebu_thermal", 0, 0,
 					       priv, &ops, NULL, 0, 0);