From: William Zhang <william.zhang@broadcom.com>
To: Jinjie Ruan <ruanjinjie@huawei.com>,
Kursad Oney <kursad.oney@broadcom.com>,
jonas.gorski@gmail.com, bcm-kernel-feedback-list@broadcom.com,
broonie@kernel.org, Anand Gore <anand.gore@broadcom.com>,
Florian Fainelli <florian.fainelli@broadcom.com>,
rafal@milecki.pl, linux-spi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: RE: [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host()
Date: Wed, 28 Aug 2024 12:09:18 -0700 [thread overview]
Message-ID: <d398b10f961866616102c7f0e4f21d0d@mail.gmail.com> (raw)
In-Reply-To: <20240826124903.3429235-3-ruanjinjie@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 2290 bytes --]
Hi Jinjie,
> -----Original Message-----
> From: Jinjie Ruan <ruanjinjie@huawei.com>
> Sent: Monday, August 26, 2024 5:49 AM
> To: william.zhang@broadcom.com; kursad.oney@broadcom.com;
> jonas.gorski@gmail.com; bcm-kernel-feedback-list@broadcom.com;
> broonie@kernel.org; anand.gore@broadcom.com;
> florian.fainelli@broadcom.com; rafal@milecki.pl;
linux-spi@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Cc: ruanjinjie@huawei.com
> Subject: [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host()
>
> Use devm_spi_alloc_host() so that there's no need to call
> spi_controller_put() in the error path.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> drivers/spi/spi-bcmbca-hsspi.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/spi/spi-bcmbca-hsspi.c
b/drivers/spi/spi-bcmbca-hsspi.c
> index f465daa473d0..d936104a41ec 100644
> --- a/drivers/spi/spi-bcmbca-hsspi.c
> +++ b/drivers/spi/spi-bcmbca-hsspi.c
> @@ -480,7 +480,7 @@ static int bcmbca_hsspi_probe(struct
> platform_device *pdev)
> }
> }
>
> - host = spi_alloc_host(&pdev->dev, sizeof(*bs));
> + host = devm_spi_alloc_host(&pdev->dev, sizeof(*bs));
> if (!host) {
> ret = -ENOMEM;
> goto out_disable_pll_clk;
> @@ -536,17 +536,17 @@ static int bcmbca_hsspi_probe(struct
> platform_device *pdev)
> ret = devm_request_irq(dev, irq, bcmbca_hsspi_interrupt,
> IRQF_SHARED,
> pdev->name, bs);
> if (ret)
> - goto out_put_host;
> + goto out_disable_pll_clk;
> }
>
> ret = devm_pm_runtime_enable(&pdev->dev);
> if (ret)
> - goto out_put_host;
> + goto out_disable_pll_clk;
>
> ret = sysfs_create_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
> if (ret) {
> dev_err(&pdev->dev, "couldn't register sysfs group\n");
> - goto out_put_host;
> + goto out_disable_pll_clk;
> }
>
> /* register and we are done */
> @@ -560,8 +560,6 @@ static int bcmbca_hsspi_probe(struct
> platform_device *pdev)
>
> out_sysgroup_disable:
> sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
> -out_put_host:
> - spi_controller_put(host);
> out_disable_pll_clk:
> clk_disable_unprepare(pll_clk);
> out_disable_clk:
> --
> 2.34.1
Reviewed-by: William Zhang <william.zhang@broadcom.com>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4212 bytes --]
next prev parent reply other threads:[~2024-08-28 19:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-26 12:49 [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable() Jinjie Ruan
2024-08-26 12:49 ` [PATCH -next 1/2] " Jinjie Ruan
2024-08-28 19:07 ` William Zhang
2024-08-26 12:49 ` [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host() Jinjie Ruan
2024-08-28 19:09 ` William Zhang [this message]
2024-08-30 13:26 ` [PATCH -next 0/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable() Mark Brown
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=d398b10f961866616102c7f0e4f21d0d@mail.gmail.com \
--to=william.zhang@broadcom.com \
--cc=anand.gore@broadcom.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=broonie@kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=jonas.gorski@gmail.com \
--cc=kursad.oney@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=rafal@milecki.pl \
--cc=ruanjinjie@huawei.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;
as well as URLs for NNTP newsgroup(s).