All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamal Dasu <kamal.dasu@broadcom.com>
To: Yangtao Li <frank.li@vivo.com>
Cc: Broadcom internal kernel review list 
	<bcm-kernel-feedback-list@broadcom.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 03/11] i2c: brcmstb: Convert to devm_platform_ioremap_resource()
Date: Mon, 10 Jul 2023 14:21:11 -0400	[thread overview]
Message-ID: <CAKekbeux2ApVp1Jcjdn-+8CS+hGtR5LGE2kL_x12MOzq41ZF-w@mail.gmail.com> (raw)
In-Reply-To: <20230710063351.17490-3-frank.li@vivo.com>

[-- Attachment #1: Type: text/plain, Size: 2635 bytes --]

On Mon, Jul 10, 2023 at 2:34 AM Yangtao Li <frank.li@vivo.com> wrote:
>
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by:  Kamal Dasu <kamal.dasu@broadcom.com>
> ---
>  drivers/i2c/busses/i2c-brcmstb.c | 19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
> index cf92cbcb8c86..0d422487161a 100644
> --- a/drivers/i2c/busses/i2c-brcmstb.c
> +++ b/drivers/i2c/busses/i2c-brcmstb.c
> @@ -594,11 +594,10 @@ static int bcm2711_release_bsc(struct brcmstb_i2c_dev *dev)
>
>  static int brcmstb_i2c_probe(struct platform_device *pdev)
>  {
> -       int rc = 0;
>         struct brcmstb_i2c_dev *dev;
>         struct i2c_adapter *adap;
> -       struct resource *iomem;
>         const char *int_name;
> +       int rc;
>
>         /* Allocate memory for private data structure */
>         dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> @@ -614,18 +613,15 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
>         init_completion(&dev->done);
>
>         /* Map hardware registers */
> -       iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       dev->base = devm_ioremap_resource(dev->device, iomem);
> -       if (IS_ERR(dev->base)) {
> -               rc = -ENOMEM;
> -               goto probe_errorout;
> -       }
> +       dev->base = devm_platform_ioremap_resource(pdev, 0);
> +       if (IS_ERR(dev->base))
> +               return PTR_ERR(dev->base);
>
>         if (of_device_is_compatible(dev->device->of_node,
>                                     "brcm,bcm2711-hdmi-i2c")) {
>                 rc = bcm2711_release_bsc(dev);
>                 if (rc)
> -                       goto probe_errorout;
> +                       return rc;
>         }
>
>         rc = of_property_read_string(dev->device->of_node, "interrupt-names",
> @@ -678,16 +674,13 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
>         adap->dev.of_node = pdev->dev.of_node;
>         rc = i2c_add_adapter(adap);
>         if (rc)
> -               goto probe_errorout;
> +               return rc;
>
>         dev_info(dev->device, "%s@%dhz registered in %s mode\n",
>                  int_name ? int_name : " ", dev->clk_freq_hz,
>                  (dev->irq >= 0) ? "interrupt" : "polling");
>
>         return 0;
> -
> -probe_errorout:
> -       return rc;
>  }
>
>  static void brcmstb_i2c_remove(struct platform_device *pdev)
> --
> 2.39.0
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4203 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Kamal Dasu <kamal.dasu@broadcom.com>
To: Yangtao Li <frank.li@vivo.com>
Cc: Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	 Andi Shyti <andi.shyti@kernel.org>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	 linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 03/11] i2c: brcmstb: Convert to devm_platform_ioremap_resource()
Date: Mon, 10 Jul 2023 14:21:11 -0400	[thread overview]
Message-ID: <CAKekbeux2ApVp1Jcjdn-+8CS+hGtR5LGE2kL_x12MOzq41ZF-w@mail.gmail.com> (raw)
In-Reply-To: <20230710063351.17490-3-frank.li@vivo.com>


[-- Attachment #1.1: Type: text/plain, Size: 2635 bytes --]

On Mon, Jul 10, 2023 at 2:34 AM Yangtao Li <frank.li@vivo.com> wrote:
>
> Use devm_platform_ioremap_resource() to simplify code.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by:  Kamal Dasu <kamal.dasu@broadcom.com>
> ---
>  drivers/i2c/busses/i2c-brcmstb.c | 19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
> index cf92cbcb8c86..0d422487161a 100644
> --- a/drivers/i2c/busses/i2c-brcmstb.c
> +++ b/drivers/i2c/busses/i2c-brcmstb.c
> @@ -594,11 +594,10 @@ static int bcm2711_release_bsc(struct brcmstb_i2c_dev *dev)
>
>  static int brcmstb_i2c_probe(struct platform_device *pdev)
>  {
> -       int rc = 0;
>         struct brcmstb_i2c_dev *dev;
>         struct i2c_adapter *adap;
> -       struct resource *iomem;
>         const char *int_name;
> +       int rc;
>
>         /* Allocate memory for private data structure */
>         dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
> @@ -614,18 +613,15 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
>         init_completion(&dev->done);
>
>         /* Map hardware registers */
> -       iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       dev->base = devm_ioremap_resource(dev->device, iomem);
> -       if (IS_ERR(dev->base)) {
> -               rc = -ENOMEM;
> -               goto probe_errorout;
> -       }
> +       dev->base = devm_platform_ioremap_resource(pdev, 0);
> +       if (IS_ERR(dev->base))
> +               return PTR_ERR(dev->base);
>
>         if (of_device_is_compatible(dev->device->of_node,
>                                     "brcm,bcm2711-hdmi-i2c")) {
>                 rc = bcm2711_release_bsc(dev);
>                 if (rc)
> -                       goto probe_errorout;
> +                       return rc;
>         }
>
>         rc = of_property_read_string(dev->device->of_node, "interrupt-names",
> @@ -678,16 +674,13 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
>         adap->dev.of_node = pdev->dev.of_node;
>         rc = i2c_add_adapter(adap);
>         if (rc)
> -               goto probe_errorout;
> +               return rc;
>
>         dev_info(dev->device, "%s@%dhz registered in %s mode\n",
>                  int_name ? int_name : " ", dev->clk_freq_hz,
>                  (dev->irq >= 0) ? "interrupt" : "polling");
>
>         return 0;
> -
> -probe_errorout:
> -       return rc;
>  }
>
>  static void brcmstb_i2c_remove(struct platform_device *pdev)
> --
> 2.39.0
>

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4203 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-07-10 18:21 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 [this message]
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 ` [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=CAKekbeux2ApVp1Jcjdn-+8CS+hGtR5LGE2kL_x12MOzq41ZF-w@mail.gmail.com \
    --to=kamal.dasu@broadcom.com \
    --cc=andi.shyti@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=frank.li@vivo.com \
    --cc=linux-arm-kernel@lists.infradead.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.