[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d398b10f961866616102c7f0e4f21d0d@mail.gmail.com>
Date: Wed, 28 Aug 2024 12:09:18 -0700
From: William Zhang <william.zhang@...adcom.com>
To: Jinjie Ruan <ruanjinjie@...wei.com>, Kursad Oney <kursad.oney@...adcom.com>,
jonas.gorski@...il.com, bcm-kernel-feedback-list@...adcom.com,
broonie@...nel.org, Anand Gore <anand.gore@...adcom.com>,
Florian Fainelli <florian.fainelli@...adcom.com>, rafal@...ecki.pl, linux-spi@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: RE: [PATCH -next 2/2] spi: bcmbca-hsspi: Use devm_spi_alloc_host()
Hi Jinjie,
> -----Original Message-----
> From: Jinjie Ruan <ruanjinjie@...wei.com>
> Sent: Monday, August 26, 2024 5:49 AM
> To: william.zhang@...adcom.com; kursad.oney@...adcom.com;
> jonas.gorski@...il.com; bcm-kernel-feedback-list@...adcom.com;
> broonie@...nel.org; anand.gore@...adcom.com;
> florian.fainelli@...adcom.com; rafal@...ecki.pl;
linux-spi@...r.kernel.org;
> linux-arm-kernel@...ts.infradead.org; linux-kernel@...r.kernel.org
> Cc: ruanjinjie@...wei.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@...wei.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@...adcom.com>
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4212 bytes)
Powered by blists - more mailing lists