From: Yangtao Li <frank.li@vivo.com>
To: Andi Shyti <andi.shyti@kernel.org>, Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>
Cc: Yangtao Li <frank.li@vivo.com>,
linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource()
Date: Wed, 5 Jul 2023 21:51:49 +0800 [thread overview]
Message-ID: <20230705135159.33327-2-frank.li@vivo.com> (raw)
In-Reply-To: <20230705135159.33327-1-frank.li@vivo.com>
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/i2c/busses/i2c-bcm-iproc.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
index 2d8342fdc25d..3fac85be543a 100644
--- a/drivers/i2c/busses/i2c-bcm-iproc.c
+++ b/drivers/i2c/busses/i2c-bcm-iproc.c
@@ -1026,7 +1026,6 @@ static int bcm_iproc_i2c_probe(struct platform_device *pdev)
int irq, ret = 0;
struct bcm_iproc_i2c_dev *iproc_i2c;
struct i2c_adapter *adap;
- struct resource *res;
iproc_i2c = devm_kzalloc(&pdev->dev, sizeof(*iproc_i2c),
GFP_KERNEL);
@@ -1039,15 +1038,12 @@ static int bcm_iproc_i2c_probe(struct platform_device *pdev)
(enum bcm_iproc_i2c_type)of_device_get_match_data(&pdev->dev);
init_completion(&iproc_i2c->done);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- iproc_i2c->base = devm_ioremap_resource(iproc_i2c->device, res);
+ iproc_i2c->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(iproc_i2c->base))
return PTR_ERR(iproc_i2c->base);
if (iproc_i2c->type == IPROC_I2C_NIC) {
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- iproc_i2c->idm_base = devm_ioremap_resource(iproc_i2c->device,
- res);
+ iproc_i2c->idm_base = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(iproc_i2c->idm_base))
return PTR_ERR(iproc_i2c->idm_base);
--
2.39.0
next prev parent reply other threads:[~2023-07-05 13:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 13:51 [PATCH 01/11] i2c: at91: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-05 13:51 ` Yangtao Li [this message]
2023-07-05 15:54 ` [PATCH 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource() Ray Jui
2023-07-05 13:51 ` [PATCH 03/11] i2c: brcmstb: " Yangtao Li
2023-07-05 13:51 ` [PATCH 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-05 13:51 ` [PATCH 05/11] i2c: stm32f4: " Yangtao Li
2023-07-05 13:51 ` [PATCH 06/11] i2c: qcom-geni: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-05 13:51 ` [PATCH 07/11] i2c: st: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-05 13:51 ` [PATCH 08/11] i2c: sh_mobile: " Yangtao Li
2023-07-05 14:44 ` Geert Uytterhoeven
2023-07-06 19:21 ` Wolfram Sang
2023-07-05 13:51 ` [PATCH 09/11] i2c: s3c2410: " Yangtao Li
2023-07-05 13:51 ` [PATCH 10/11] i2c: pxa: " Yangtao Li
2023-07-05 13:51 ` [PATCH 11/11] i2c: pnx: " Yangtao Li
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=20230705135159.33327-2-frank.li@vivo.com \
--to=frank.li@vivo.com \
--cc=andi.shyti@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®