From patchwork Mon Mar 4 06:45:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 2210751 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 4A6EB3FCF2 for ; Mon, 4 Mar 2013 06:56:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750803Ab3CDG4D (ORCPT ); Mon, 4 Mar 2013 01:56:03 -0500 Received: from mail-da0-f50.google.com ([209.85.210.50]:64218 "EHLO mail-da0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750727Ab3CDG4C (ORCPT ); Mon, 4 Mar 2013 01:56:02 -0500 Received: by mail-da0-f50.google.com with SMTP id h15so2363239dan.23 for ; Sun, 03 Mar 2013 22:56:01 -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 :x-gm-message-state; bh=Ezgaa4HQBeSisUt1Mn5j03p7bBdBsR5Vlv63ni4QD28=; b=U9GBE0bmS3P7ZpXlATatHYa1lUeZ7RwdsqqFzoIqVui+vftA+I3gZhS5DTLfAHX006 ypLEV9HHENHPlRisrqIm4sSGwvMWIUGnDMAYgv0DWcbCI/0Fuw31RDcWAD8i81P4YNbS Tbs3/kXsQGQ3ISKWj1LYYGgCHaKvnb7/Ctl0guW8H2bn5KHdO4L1K+vNKe8NvWMf11eQ C0ZByl0SMgnMVPUtG+aXnibAZcb56FFaPIuQjHNIYfBr3ycK3/ZtOrE1n6YHAQIVUOx3 FZrLVNxzE77nUkQIKuk5FPYP0bmwe+k9S54+rhHVWju9y3QPPyD+ZtFtRKrUUsEs/ROl 8pow== X-Received: by 10.68.252.70 with SMTP id zq6mr27160919pbc.136.1362380161911; Sun, 03 Mar 2013 22:56:01 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ou3sm4051252pbc.7.2013.03.03.22.55.58 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 03 Mar 2013 22:56:01 -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, Andrew Lunn Subject: [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource() Date: Mon, 4 Mar 2013 12:15:32 +0530 Message-Id: <1362379534-30662-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQk1VA77GQcZOpZ/sk/1eRACfMwqSROI3AwxoOm+BHdFXYYu7RKzUtU5UlWz0/xt6f4WgEsi 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: Andrew Lunn Reviewed-by: Thierry Reding --- 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) {