All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yangtao Li <frank.li@vivo.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Andi Shyti <andi.shyti@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
	linux-renesas-soc@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 08/11] i2c: sh_mobile: Use devm_platform_get_and_ioremap_resource()
Date: Mon, 10 Jul 2023 14:33:47 +0800	[thread overview]
Message-ID: <20230710063351.17490-8-frank.li@vivo.com> (raw)
In-Reply-To: <20230710063351.17490-1-frank.li@vivo.com>

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
v2:
-s/devm_platform_get_and_ioremap_resource(pdev/devm_platform_get_and_ioremap_resource(dev
 drivers/i2c/busses/i2c-sh_mobile.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 21717b943a9e..163fc118873f 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -871,7 +871,6 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 {
 	struct sh_mobile_i2c_data *pd;
 	struct i2c_adapter *adap;
-	struct resource *res;
 	const struct sh_mobile_dt_config *config;
 	int ret;
 	u32 bus_speed;
@@ -893,10 +892,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 	pd->dev = &dev->dev;
 	platform_set_drvdata(dev, pd);
 
-	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-
-	pd->res = res;
-	pd->reg = devm_ioremap_resource(&dev->dev, res);
+	pd->reg = devm_platform_get_and_ioremap_resource(dev, 0, &pd->res);
 	if (IS_ERR(pd->reg))
 		return PTR_ERR(pd->reg);
 
@@ -905,7 +901,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
 	pd->clks_per_count = 1;
 
 	/* Newer variants come with two new bits in ICIC */
-	if (resource_size(res) > 0x17)
+	if (resource_size(pd->res) > 0x17)
 		pd->flags |= IIC_FLAG_HAS_ICIC67;
 
 	pm_runtime_enable(&dev->dev);
-- 
2.39.0


  parent reply	other threads:[~2023-07-10  6:36 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-10  6:33 [PATCH v2 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-10  6:33 ` Yangtao Li
2023-07-10  6:33 ` [PATCH v2 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-10  6:33   ` Yangtao Li
2023-07-12 15:40   ` Andi Shyti
2023-07-12 15:40     ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 03/11] i2c: brcmstb: " Yangtao Li
2023-07-10  6:33   ` Yangtao Li
2023-07-10 18:21   ` Kamal Dasu
2023-07-10 18:21     ` Kamal Dasu
2023-07-10 21:00   ` Florian Fainelli
2023-07-10 21:00     ` Florian Fainelli
2023-07-12 15:43   ` Andi Shyti
2023-07-12 15:43     ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-12 15:49   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 05/11] i2c: stm32f4: " Yangtao Li
2023-07-10  6:33   ` Yangtao Li
2023-07-12 15:49   ` Andi Shyti
2023-07-12 15:49     ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 06/11] i2c: qcom-geni: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-12 15:52   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 07/11] i2c: st: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-10  6:33   ` Yangtao Li
2023-07-12 15:52   ` Andi Shyti
2023-07-12 15:52     ` Andi Shyti
2023-07-10  6:33 ` Yangtao Li [this message]
2023-07-10 12:13   ` [PATCH v2 08/11] i2c: sh_mobile: " Geert Uytterhoeven
2023-07-12 15:57   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 09/11] i2c: s3c2410: " Yangtao Li
2023-07-10  6:33   ` Yangtao Li
2023-07-12 15:58   ` Andi Shyti
2023-07-12 15:58     ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 10/11] i2c: pxa: " Yangtao Li
2023-07-12 15:59   ` Andi Shyti
2023-07-10  6:33 ` [PATCH v2 11/11] i2c: pnx: " Yangtao Li
2023-07-10  6:33   ` Yangtao Li
2023-07-12 16:00   ` Andi Shyti
2023-07-12 16:00     ` Andi Shyti
2023-07-12 15:37 ` [PATCH v2 01/11] i2c: at91: " Andi Shyti
2023-07-12 15:37   ` Andi Shyti
2023-08-14 16:10 ` Wolfram Sang
2023-08-14 16:10   ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230710063351.17490-8-frank.li@vivo.com \
    --to=frank.li@vivo.com \
    --cc=andi.shyti@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.