Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp638899ybe; Wed, 4 Sep 2019 05:38:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaBO7pdCbLE+6k1wydV4K26L/ovAGE60cPgWjGPBpbpNma7oFTHyKtD9agI+GhKlxsqnq6 X-Received: by 2002:a63:d04e:: with SMTP id s14mr33253516pgi.189.1567600693080; Wed, 04 Sep 2019 05:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567600693; cv=none; d=google.com; s=arc-20160816; b=WAllVldeJi36Lz+/NpFnlel5JjW2hznl6zYEKrtGJ6MauqlLQ36zTFtPMDDYpNYE4l jMyg85G9miI0fue/q2h04jlisnzHFZm47jbZl5e1oG45KDX5LD9n6Av1Fj6U3hl64XgU iDTojFVRdUzSzK0+ZKybBV8zOndUF/ckD2OSeO5szRc7bD+omUk+tl6F970wS+mR0XvX xw1ERs4ISH9UcFY2MyZAL3J0w6Gxc1/n5zakilO7cexIa9VPRHqnxey0+9LMyzcWMH/O CpRlH0DngeZ0YY1aPRLD8XZXeQb6JM7/5O5kylDlGi7a1wZ0h7EZsq+eMphwuKNuGIki 02Ug== 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=XfLc4e6bBvOHv7+MxWR/DWjc4OHUUgNsSNGQITINTL8=; b=PyQhzjDgkQsauD9eg2tMII5k/zxAmH/wk97yxz/PC7Sqx7pPidgK2lQcPayAhDxlqM 4459O+35v4yxCRLxKPjhzPgZUW6cF9Tw0aT3zTGxZtn/4oDRBpzBIslG0KhMz6wGTdrI nWuRCNDKxhctaPM/48C8VEVTeL0aaxaLijQ6GFIP8aAgXA3oJ9NMQ9lgsE3HtWLE/gdu 8KNxSKugCnyZ76NiURPdwMhwyKKmXeVxJEWxAsbj2iAwf/eYcWqJYiGuDFaj6/pHdfqp DpWDz28ndh28U9U5cjANZfhrfOv+ivr3FTE725nlJ2xGFoouaAEbNnmO+xuVbp6K4d1M HB+w== 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 r2si4842539pfh.74.2019.09.04.05.37.57; Wed, 04 Sep 2019 05:38:13 -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 S1730226AbfIDMes (ORCPT + 99 others); Wed, 4 Sep 2019 08:34:48 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57230 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730205AbfIDMer (ORCPT ); Wed, 4 Sep 2019 08:34:47 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C0EC68271B1F103FB06F; Wed, 4 Sep 2019 20:34:45 +0800 (CST) Received: from localhost (10.133.213.239) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Sep 2019 20:34:37 +0800 From: YueHaibing To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , , , , , , , Subject: [PATCH -next 08/15] thermal: tsens: use devm_platform_ioremap_resource() to simplify code Date: Wed, 4 Sep 2019 20:29:32 +0800 Message-ID: <20190904122939.23780-9-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/qcom/tsens-common.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index 528df88..43ce4fb 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -155,7 +155,6 @@ int __init init_common(struct tsens_priv *priv) { void __iomem *tm_base, *srot_base; struct device *dev = priv->dev; - struct resource *res; u32 enabled; int ret, i, j; struct platform_device *op = of_find_device_by_node(priv->dev->of_node); @@ -166,8 +165,7 @@ int __init init_common(struct tsens_priv *priv) if (op->num_resources > 1) { /* DT with separate SROT and TM address space */ priv->tm_offset = 0; - res = platform_get_resource(op, IORESOURCE_MEM, 1); - srot_base = devm_ioremap_resource(&op->dev, res); + srot_base = devm_platform_ioremap_resource(op, 1); if (IS_ERR(srot_base)) { ret = PTR_ERR(srot_base); goto err_put_device; @@ -184,8 +182,7 @@ int __init init_common(struct tsens_priv *priv) priv->tm_offset = 0x1000; } - res = platform_get_resource(op, IORESOURCE_MEM, 0); - tm_base = devm_ioremap_resource(&op->dev, res); + tm_base = devm_platform_ioremap_resource(op, 0); if (IS_ERR(tm_base)) { ret = PTR_ERR(tm_base); goto err_put_device; -- 2.7.4