From patchwork Mon Mar 4 06:45:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2210771 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A66703FCF2 for ; Mon, 4 Mar 2013 06:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752453Ab3CDG4J (ORCPT ); Mon, 4 Mar 2013 01:56:09 -0500 Received: from mail-da0-f54.google.com ([209.85.210.54]:49979 "EHLO mail-da0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805Ab3CDG4I (ORCPT ); Mon, 4 Mar 2013 01:56:08 -0500 Received: by mail-da0-f54.google.com with SMTP id p1so2396254dad.13 for ; Sun, 03 Mar 2013 22:56:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=l6XKS4/2Ej8KWOlsbNQKPAnM1Dzerh0C4/xyejzp8S4=; b=X2ZpZktWjO8w/8/+Jb0vqutJ8TQuRJ7rzshm1zJxTOPm2rn/GHcjiHRxuKRsxW+HMA eAl9ylHqbTRDsJ1sQkgE2SGqfa3kewHhe7GS83xCd5MebTVM823eGhj40WI8ktcro2eH BD/+sXTFDij6SjKCOV9c0LqQfb+eO86km+q3SA+PEleeRaRtmiUuicq0efbLuGpn9i4n Ob5I0StDUMe3fLxYnQ04qybErqzSWx6NM+l+YK5FVdBH13D4/co6U7BqaezohSVNGcGy 7Z3+lNIUtdqjUefOf9A5THPsVlBCBKwCyyWU0xynzrtisKwN5GnDbZiFkJdeNcZNN2fg ofqA== X-Received: by 10.66.149.133 with SMTP id ua5mr30539661pab.122.1362380167867; Sun, 03 Mar 2013 22:56:07 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ou3sm4051252pbc.7.2013.03.03.22.56.05 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 03 Mar 2013 22:56:07 -0800 (PST) From: Sachin Kamat To: linux-pm@vger.kernel.org Cc: rui.zhang@intel.com, thierry.reding@avionic-design.de, sachin.kamat@linaro.org, Nobuhiro Iwamatsu Subject: [PATCH 3/3] Thermal: kirkwood: Convert to devm_ioremap_resource() Date: Mon, 4 Mar 2013 12:15:34 +0530 Message-Id: <1362379534-30662-3-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1362379534-30662-1-git-send-email-sachin.kamat@linaro.org> References: <1362379534-30662-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQmFFYRLsETxRFRpz5VqzRjhff7Q2pmnjLjr7JMK8sF7fxzyHU7catKnMt24xk9Ua0nV9wOw Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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 Cc: Nobuhiro Iwamatsu Reviewed-by: Thierry Reding Acked-by: Nobuhiro Iwamatsu --- 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);