From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH 06/16] thermal: mvebu: Convert to devm_ioremap_resource() Date: Thu, 21 Mar 2013 07:10:24 +0100 Message-ID: <20130321061024.GH21478@lunn.ch> References: <1363818997-23137-1-git-send-email-ezequiel.garcia@free-electrons.com> <1363818997-23137-7-git-send-email-ezequiel.garcia@free-electrons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from londo.lunn.ch ([80.238.139.98]:49793 "EHLO londo.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752996Ab3CUGKj (ORCPT ); Thu, 21 Mar 2013 02:10:39 -0400 Content-Disposition: inline In-Reply-To: <1363818997-23137-7-git-send-email-ezequiel.garcia@free-electrons.com> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Ezequiel Garcia Cc: linux-arm-kernel@lists.infradead.org, Zhang Rui , linux-pm@vger.kernel.org, Thomas Petazzoni , Gregory Clement , Nobuhiro Iwamatsu , Andrew Lunn , Jason Cooper , Florian Fainelli , Sebastian Hesselbarth , Lior Amsalem On Wed, Mar 20, 2013 at 07:36:27PM -0300, 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 > --- > drivers/thermal/mvebu_thermal.c | 6 ++---- > 1 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/thermal/mvebu_thermal.c b/drivers/thermal/mvebu_thermal.c > index ef04e4e..089b43d 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"); > + priv->sensor = devm_ioremap_resource(&pdev->dev, res); > + if (!priv->sensor) > return -EADDRNOTAVAIL; > - } Hi Ezequiel It would be better to return priv->sensor, not a fixed error code. Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrew@lunn.ch (Andrew Lunn) Date: Thu, 21 Mar 2013 07:10:24 +0100 Subject: [PATCH 06/16] thermal: mvebu: Convert to devm_ioremap_resource() In-Reply-To: <1363818997-23137-7-git-send-email-ezequiel.garcia@free-electrons.com> References: <1363818997-23137-1-git-send-email-ezequiel.garcia@free-electrons.com> <1363818997-23137-7-git-send-email-ezequiel.garcia@free-electrons.com> Message-ID: <20130321061024.GH21478@lunn.ch> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Mar 20, 2013 at 07:36:27PM -0300, 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 > --- > drivers/thermal/mvebu_thermal.c | 6 ++---- > 1 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/thermal/mvebu_thermal.c b/drivers/thermal/mvebu_thermal.c > index ef04e4e..089b43d 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"); > + priv->sensor = devm_ioremap_resource(&pdev->dev, res); > + if (!priv->sensor) > return -EADDRNOTAVAIL; > - } Hi Ezequiel It would be better to return priv->sensor, not a fixed error code. Andrew