All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yangtao Li <frank.li@vivo.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 10/11] i2c: pxa: Use devm_platform_get_and_ioremap_resource()
Date: Mon, 10 Jul 2023 14:33:49 +0800	[thread overview]
Message-ID: <20230710063351.17490-10-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-pxa.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 937f7eebe906..b630bfeaeb85 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -1362,7 +1362,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
 	struct i2c_pxa_platform_data *plat = dev_get_platdata(&dev->dev);
 	enum pxa_i2c_types i2c_type;
 	struct pxa_i2c *i2c;
-	struct resource *res = NULL;
+	struct resource *res;
 	int ret, irq;
 
 	i2c = devm_kzalloc(&dev->dev, sizeof(struct pxa_i2c), GFP_KERNEL);
@@ -1379,8 +1379,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
 	i2c->adap.dev.of_node = dev->dev.of_node;
 #endif
 
-	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
-	i2c->reg_base = devm_ioremap_resource(&dev->dev, res);
+	i2c->reg_base = devm_platform_get_and_ioremap_resource(dev, 0, &res);
 	if (IS_ERR(i2c->reg_base))
 		return PTR_ERR(i2c->reg_base);
 
-- 
2.39.0


  parent reply	other threads:[~2023-07-10  6:35 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 ` [PATCH v2 08/11] i2c: sh_mobile: " Yangtao Li
2023-07-10 12:13   ` 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 ` Yangtao Li [this message]
2023-07-12 15:59   ` [PATCH v2 10/11] i2c: pxa: " 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-10-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 \
    /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.