Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp636472ybe; Wed, 4 Sep 2019 05:36:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+F2L0QHwdlQoOA665hlieN+CCbT0YHLBnGOk1Celgr5SPInSwWwdVrX0PkA2yWJS1E6KX X-Received: by 2002:a63:607:: with SMTP id 7mr34662316pgg.240.1567600563122; Wed, 04 Sep 2019 05:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567600563; cv=none; d=google.com; s=arc-20160816; b=z2Gq4GmcSc7Vh7GCXO3nIiXjZPQzrQ4KJNQ4UD99dgi14zKUbqqgL4oD7Z1atFq6d3 XVUmIv+0n4jjJQY/XJ7LZXtiEUvX7WJBAULGRhzG3G4vCiVfMeVBvbfDFlfFAvslOXSm 6tuoBc+97g8dcGlXrRK5svYcS48rUI+dxtM7DKG+RkUra3EHK0Sk1T78EYCZKVOHlJDK aEV0DXlmUodx7693A4PTnKVHqonILC7ZMY8qlmtaDT8dw7InAmEuZRPFF0oLKIa/C7Zo RnJmAFKWDBlnPhOqJUO2FqtLA7oDG6wCKa3fcVukhlwvmMh3uQNUhJgVniflEA+SJINr ZCvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=Uvc8/FeAu5mSjdtsqY7BWgn8eMo24Sc9FJvsdyg85Vw=; b=ccBGNs+eAK30QKc6PyriZlGeDpatE6cZhA7OXDjW//MV7yJ8VvJkueYX1c/opVUw5p irSrOCIw1tlCTwGgG2zJ7p9VukSUY5ifTZKctucqppAF2q81sIYe2MON31C7nhRiEzuH WV43wUSNJk1TOqWVL+hZoyEzgA7PigU7k882qiAArsSPky5GZwTclDYeNEbi76X+XSgr zoN6TqRAzmklDLy4JH41fxITUGmQxcwXmCIrMIsmlhCFd6YAxijscI/HuK3TzPO3AtZJ HRdXI4dRSRZydMykceMNnzmN/bRBFsHh4KXZTineqW8L4V+tWu6TITohBPUznGd6dPFO nGjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2si2248287pji.79.2019.09.04.05.35.47; Wed, 04 Sep 2019 05:36:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730185AbfIDMel (ORCPT + 99 others); Wed, 4 Sep 2019 08:34:41 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5762 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730156AbfIDMek (ORCPT ); Wed, 4 Sep 2019 08:34:40 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0C0D13D58C0B4DDFA8C4; Wed, 4 Sep 2019 20:34:39 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Sep 2019 20:34:30 +0800 From: YueHaibing To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , , , Subject: [PATCH -next 05/15] thermal: dove: use devm_platform_ioremap_resource() to simplify code Date: Wed, 4 Sep 2019 20:29:29 +0800 Message-ID: <20190904122939.23780-6-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 In-Reply-To: <20190904122939.23780-1-yuehaibing@huawei.com> References: <20190904122939.23780-1-yuehaibing@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.133.213.239] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot Signed-off-by: YueHaibing --- drivers/thermal/dove_thermal.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c index 75901ce..e53ac71 100644 --- a/drivers/thermal/dove_thermal.c +++ b/drivers/thermal/dove_thermal.c @@ -122,20 +122,17 @@ static int dove_thermal_probe(struct platform_device *pdev) { struct thermal_zone_device *thermal = NULL; struct dove_thermal_priv *priv; - struct resource *res; int ret; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - priv->sensor = devm_ioremap_resource(&pdev->dev, res); + priv->sensor = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(priv->sensor)) return PTR_ERR(priv->sensor); - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - priv->control = devm_ioremap_resource(&pdev->dev, res); + priv->control = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(priv->control)) return PTR_ERR(priv->control); -- 2.7.4