Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4528333ybb; Tue, 14 Apr 2020 09:02:02 -0700 (PDT) X-Google-Smtp-Source: APiQypKAmrz/whErrcz0D/aZVHvW5EoRNoSt+9mt8/tfpdY59hoZJCC6l+1n+zAhqRHfnMj7qrfi X-Received: by 2002:a5d:420d:: with SMTP id n13mr24211268wrq.204.1586880122478; Tue, 14 Apr 2020 09:02:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586880122; cv=none; d=google.com; s=arc-20160816; b=Sm/n54H5BnNISP3vZIRgsPKpUb6C6HKGtgvByP4/LRfrIBLh2nLGRo0KSziN6NdTEO 7lur5U8UeEH4Rc7QrLUVLYxJ+AzjTEAgha6reJPSM+XnV9Yq9Tb3RYfkT0zSLsV5kk7Y uEB8NIN2YIQ1IyU6ffPGGDVVY0dbA+RsIPM+Psg5dpQ3qyq+kSyJQcqkkDLJbrLbOvNR eoROfH5q42Q/zOWumH0ZeAz6BrNS/1hSkRxRDAFTZnJadiVvnbTxmsU40eS+kgIRhppt v6ZXILB4Q7C7ylpm+SnM1l3TX/ivYSjAcM2TqMQwW0xIMMSTUss7lSEIoUVw/7RazLCl DMVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tRIC1+fbqgksFCXZuCIwbMy1gMACOqNnoWCEPyufkRo=; b=buEWtGg57HzKiBpPsunYzudtlYmHGGlVdBj9y8O2gJrJ0/57OZN540ZwCWqqIiEjsb 11WBQdgEvgh0wK6T0He8lcMLaZZFzh3qRfGKiXqVUmN8wt4rMjd9KWesC90ZKXtS9k7z scM3s2uYRmniavb1sTPNXdltylzH3DBV5GSnRvtRRp8aAbLAEcYKMR6miCZ3vY1NW2un M5JFD1ip/+L61H3rzX5suyWwGnCPnFg9SR1+7iJHmfRmg0HU2lXjiipGZ0Rq5SeJ4qcr TzTCArT34diqvcX66g3LfpRC1eezubgkYmqedQZ2Yiy/wbGkKvB6O3B4fetcjT9X5Qc7 XLfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="GaO/qKQO"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc18si8561037edb.498.2020.04.14.09.01.37; Tue, 14 Apr 2020 09:02:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="GaO/qKQO"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388154AbgDNNsv (ORCPT + 99 others); Tue, 14 Apr 2020 09:48:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727991AbgDNNsg (ORCPT ); Tue, 14 Apr 2020 09:48:36 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B04CC061A0C; Tue, 14 Apr 2020 06:48:35 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id h11so4666129plr.11; Tue, 14 Apr 2020 06:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tRIC1+fbqgksFCXZuCIwbMy1gMACOqNnoWCEPyufkRo=; b=GaO/qKQOZHoYDBE0SZJhbEGpsDQbuszrib3RZ+LJ4A9j8Jpt43q+nfImee6LnjJ+j/ aR8OOlq5dPwT1bFM7V+3RYw78okenlCnJXMsZYvnGOP95JFuWYxDxQQDLadVHaJ0jV8S Dz0RnmM+GdP/zaU++I85DtwtYRhtfdbluCsGpJn9Oy15ByBq6ysdXVIDPMh825yh1wYd pp4dIKSYES6/riRi0KecsSOdbDwZNIvFIiw7pELOFQEBy1kmKs7lbV1UKfikocbd84wz xRLiaQuj4ssVo5PvKaRnZlYgWxbxmm/frB53eAnJVbTEcz17KjfIqMsWPK+e2OW/uYRY G7rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tRIC1+fbqgksFCXZuCIwbMy1gMACOqNnoWCEPyufkRo=; b=pB3BR3sE1ouzJsb/alituJQPzBoaHjSrbjUZhfJqU0fgRpxQ+8ELfzoIrgP3VQUJik cGP5Cl5OOkPzIx7QRGE+JCiFONh6tb1TiPvcXsfPoMZC4JHILNe++mnssk8xERoDYor4 /3kmO+qQjeApeCql9Wpn8OgtW3vV9OSKzeh/TJi3ZDBK4wZqXEuLG60f+G1Vt9hhAyGV oX+yBqwmVBa8BkB017PruuXZ220QxS4/WMuEXXEvsexbrXLSrrxOVv2g5jP8s4Lmm7gb 5PswPuPafgl4XoeVBtTXBaLintZ4Igpxw4S/LlG9HySHa14gt9IPZ/p+jD/xRddZUf6w 8Zag== X-Gm-Message-State: AGi0PuaYElEE9qPi1z5dWc/HLORv7eJAO/jRgWIqLCtl5LuLDu0UO4Ga QU8xQQ8pjY4o9ugmnU3qqGk= X-Received: by 2002:a17:90b:3444:: with SMTP id lj4mr185611pjb.37.1586872114531; Tue, 14 Apr 2020 06:48:34 -0700 (PDT) Received: from localhost ([89.208.244.140]) by smtp.gmail.com with ESMTPSA id g3sm10233341pgd.64.2020.04.14.06.48.33 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Apr 2020 06:48:34 -0700 (PDT) From: Dejin Zheng To: michal.simek@xilinx.com, wsa+renesas@sang-engineering.com, pierre-yves.mordret@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, alain.volmat@st.com, linux-i2c@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Dejin Zheng Subject: [PATCH v1] i2c: busses: convert to devm_platform_get_and_ioremap_resource Date: Tue, 14 Apr 2020 21:48:27 +0800 Message-Id: <20200414134827.18674-1-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org use devm_platform_get_and_ioremap_resource() to simplify code, which contains platform_get_resource() and devm_ioremap_resource(), it also get the resource for use by the following code. Signed-off-by: Dejin Zheng --- drivers/i2c/busses/i2c-cadence.c | 3 +-- drivers/i2c/busses/i2c-pca-platform.c | 3 +-- drivers/i2c/busses/i2c-rcar.c | 4 +--- drivers/i2c/busses/i2c-stm32f7.c | 3 +-- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c index 89d58f7d2a25..803c802611eb 100644 --- a/drivers/i2c/busses/i2c-cadence.c +++ b/drivers/i2c/busses/i2c-cadence.c @@ -906,8 +906,7 @@ static int cdns_i2c_probe(struct platform_device *pdev) id->quirks = data->quirks; } - r_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - id->membase = devm_ioremap_resource(&pdev->dev, r_mem); + id->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem); if (IS_ERR(id->membase)) return PTR_ERR(id->membase); diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c index 635dd697ac0b..546426a470cc 100644 --- a/drivers/i2c/busses/i2c-pca-platform.c +++ b/drivers/i2c/busses/i2c-pca-platform.c @@ -149,8 +149,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev) if (!i2c) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - i2c->reg_base = devm_ioremap_resource(&pdev->dev, res); + i2c->reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(i2c->reg_base)) return PTR_ERR(i2c->reg_base); diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 3b5397aa4ca6..a45c4bf1ec01 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -938,9 +938,7 @@ static int rcar_i2c_probe(struct platform_device *pdev) return PTR_ERR(priv->clk); } - priv->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - - priv->io = devm_ioremap_resource(dev, priv->res); + priv->io = devm_platform_get_and_ioremap_resource(pdev, 0, &priv->res); if (IS_ERR(priv->io)) return PTR_ERR(priv->io); diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index 330ffed011e0..cf48f8df4423 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -1940,8 +1940,7 @@ static int stm32f7_i2c_probe(struct platform_device *pdev) if (!i2c_dev) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - i2c_dev->base = devm_ioremap_resource(&pdev->dev, res); + i2c_dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(i2c_dev->base)) return PTR_ERR(i2c_dev->base); phy_addr = (dma_addr_t)res->start; -- 2.25.0