mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@kernel.org>
To: Yangtao Li <frank.li@vivo.com>
Cc: Khalil Blaiech <kblaiech@nvidia.com>,
	Asmaa Mnebhi <asmaa@nvidia.com>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 04/11] i2c: mlxbf: Use devm_platform_get_and_ioremap_resource()
Date: Wed, 12 Jul 2023 17:49:07 +0200	[thread overview]
Message-ID: <20230712154907.zj7qvt5qml4g5khj@intel.intel> (raw)
In-Reply-To: <20230710063351.17490-4-frank.li@vivo.com>

Hi Yangtao,

On Mon, Jul 10, 2023 at 02:33:43PM +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> 

> ---
>  drivers/i2c/busses/i2c-mlxbf.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
> index ae66bdd1b737..2f60e5532b54 100644
> --- a/drivers/i2c/busses/i2c-mlxbf.c
> +++ b/drivers/i2c/busses/i2c-mlxbf.c
> @@ -1080,13 +1080,7 @@ static int mlxbf_i2c_init_resource(struct platform_device *pdev,
>  	if (!tmp_res)
>  		return -ENOMEM;
>  
> -	tmp_res->params = platform_get_resource(pdev, IORESOURCE_MEM, type);
> -	if (!tmp_res->params) {
> -		devm_kfree(dev, tmp_res);
> -		return -EIO;
> -	}
> -
> -	tmp_res->io = devm_ioremap_resource(dev, tmp_res->params);
> +	tmp_res->io = devm_platform_get_and_ioremap_resource(pdev, type, &tmp_res->params);
>  	if (IS_ERR(tmp_res->io)) {
>  		devm_kfree(dev, tmp_res);

In a later patch we could also remove this redundant
devm_kfree().

Andi

>  		return PTR_ERR(tmp_res->io);
> -- 
> 2.39.0
> 

  reply	other threads:[~2023-07-12 15:49 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 [this message]
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
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=20230712154907.zj7qvt5qml4g5khj@intel.intel \
    --to=andi.shyti@kernel.org \
    --cc=asmaa@nvidia.com \
    --cc=frank.li@vivo.com \
    --cc=kblaiech@nvidia.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®