All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: linux-pm@vger.kernel.org
Cc: eduardo.valentin@ti.com, Zhang Rui <rui.zhang@intel.com>,
	Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
	Vincenzo Frascino <vincenzo.frascino@st.com>
Subject: [PATCH 2/2] Thermal: don't check resource with devm_ioremap_resource
Date: Thu, 16 May 2013 10:16:21 +0800	[thread overview]
Message-ID: <1368670581-4846-2-git-send-email-rui.zhang@intel.com> (raw)
In-Reply-To: <1368670581-4846-1-git-send-email-rui.zhang@intel.com>

devm_ioremap_resource does sanity checks on the given resource.
No need to duplicate this in the driver.

CC: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
CC: Vincenzo Frascino <vincenzo.frascino@st.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 drivers/thermal/armada_thermal.c |   10 ----------
 drivers/thermal/spear_thermal.c  |    7 +------
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index 0d02d4e..0491465 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -169,21 +169,11 @@ static int armada_thermal_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "Failed to get platform resource\n");
-		return -ENODEV;
-	}
-
 	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_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(priv->control))
 		return PTR_ERR(priv->control);
diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
index 1b652ab..fa30918 100644
--- a/drivers/thermal/spear_thermal.c
+++ b/drivers/thermal/spear_thermal.c
@@ -118,13 +118,8 @@ static int spear_thermal_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "memory resource missing\n");
-		return -ENODEV;
-	}
-
 	/* Enable thermal sensor */
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	stdev->thermal_base = devm_ioremap_resource(dev, res);
 	if (IS_ERR(stdev->thermal_base)) {
 		dev_err(&pdev->dev, "ioremap failed\n");
-- 
1.7.9.5


  reply	other threads:[~2013-05-16  2:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16  2:16 [PATCH 1/2] Thermal: spear_thermal: convert to devm_ioremap_resource Zhang Rui
2013-05-16  2:16 ` Zhang Rui [this message]
2013-05-16  8:46   ` [PATCH 2/2] Thermal: don't check resource with devm_ioremap_resource Ezequiel Garcia
2013-05-20 15:39   ` Zhang, Rui
2013-05-20 15:39 ` [PATCH 1/2] Thermal: spear_thermal: convert to devm_ioremap_resource Zhang, Rui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368670581-4846-2-git-send-email-rui.zhang@intel.com \
    --to=rui.zhang@intel.com \
    --cc=eduardo.valentin@ti.com \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=vincenzo.frascino@st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.