From: Andi Shyti <andi.shyti@kernel.org>
To: Yangtao Li <frank.li@vivo.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 10/11] i2c: pxa: Use devm_platform_get_and_ioremap_resource()
Date: Wed, 12 Jul 2023 17:59:37 +0200 [thread overview]
Message-ID: <20230712155937.xekbw7straoh5xor@intel.intel> (raw)
In-Reply-To: <20230710063351.17490-10-frank.li@vivo.com>
Hi Yangtao,
On Mon, Jul 10, 2023 at 02:33:49PM +0800, Yangtao Li wrote:
> 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>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Andi
> ---
> 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
>
next prev parent reply other threads:[~2023-07-12 15:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 6:33 [PATCH v2 01/11] i2c: at91: " Yangtao Li
2023-07-10 6:33 ` [PATCH v2 02/11] i2c: iproc: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-12 15:40 ` Andi Shyti
2023-07-10 6:33 ` [PATCH v2 03/11] i2c: brcmstb: " Yangtao Li
2023-07-10 18:21 ` Kamal Dasu
2023-07-10 21:00 ` Florian Fainelli
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-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-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-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 [this message]
2023-07-10 6:33 ` [PATCH v2 11/11] i2c: pnx: " Yangtao Li
2023-07-12 16:00 ` Andi Shyti
2023-07-12 15:37 ` [PATCH v2 01/11] i2c: at91: " Andi Shyti
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=20230712155937.xekbw7straoh5xor@intel.intel \
--to=andi.shyti@kernel.org \
--cc=frank.li@vivo.com \
--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 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®