diff mbox series

[-next,1/2] spi: bcmbca-hsspi: Fix missing pm_runtime_disable()

Message ID 20240826124903.3429235-2-ruanjinjie@huawei.com (mailing list archive)
State Accepted
Commit 4439a2e92cb89028b22c5d7ba1b99e75d7d889f6
Headers show
Series spi: bcmbca-hsspi: Fix missing pm_runtime_disable() | expand

Commit Message

Jinjie Ruan Aug. 26, 2024, 12:49 p.m. UTC
The pm_runtime_disable() is missing in remove function, use
devm_pm_runtime_enable() to fix it. So the pm_runtime_disable() in
the probe error path can also be removed.

Fixes: a38a2233f23b ("spi: bcmbca-hsspi: Add driver for newer HSSPI controller")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/spi/spi-bcmbca-hsspi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

William Zhang Aug. 28, 2024, 7:07 p.m. UTC | #1
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 1/2] spi: bcmbca-hsspi: Fix missing
> pm_runtime_disable()
>
> The pm_runtime_disable() is missing in remove function, use
> devm_pm_runtime_enable() to fix it. So the pm_runtime_disable() in
> the probe error path can also be removed.
>
> Fixes: a38a2233f23b ("spi: bcmbca-hsspi: Add driver for newer HSSPI
> controller")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
>  drivers/spi/spi-bcmbca-hsspi.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-bcmbca-hsspi.c
b/drivers/spi/spi-bcmbca-hsspi.c
> index e48a56c68ce7..f465daa473d0 100644
> --- a/drivers/spi/spi-bcmbca-hsspi.c
> +++ b/drivers/spi/spi-bcmbca-hsspi.c
> @@ -539,12 +539,14 @@ static int bcmbca_hsspi_probe(struct
> platform_device *pdev)
>  			goto out_put_host;
>  	}
>
> -	pm_runtime_enable(&pdev->dev);
> +	ret = devm_pm_runtime_enable(&pdev->dev);
> +	if (ret)
> +		goto out_put_host;
>
>  	ret = sysfs_create_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
>  	if (ret) {
>  		dev_err(&pdev->dev, "couldn't register sysfs group\n");
> -		goto out_pm_disable;
> +		goto out_put_host;
>  	}
>
>  	/* register and we are done */
> @@ -558,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_pm_disable:
> -	pm_runtime_disable(&pdev->dev);
>  out_put_host:
>  	spi_controller_put(host);
>  out_disable_pll_clk:
> --
> 2.34.1

Reviewed-by: William Zhang <william.zhang@broadcom.com>
diff mbox series

Patch

diff --git a/drivers/spi/spi-bcmbca-hsspi.c b/drivers/spi/spi-bcmbca-hsspi.c
index e48a56c68ce7..f465daa473d0 100644
--- a/drivers/spi/spi-bcmbca-hsspi.c
+++ b/drivers/spi/spi-bcmbca-hsspi.c
@@ -539,12 +539,14 @@  static int bcmbca_hsspi_probe(struct platform_device *pdev)
 			goto out_put_host;
 	}
 
-	pm_runtime_enable(&pdev->dev);
+	ret = devm_pm_runtime_enable(&pdev->dev);
+	if (ret)
+		goto out_put_host;
 
 	ret = sysfs_create_group(&pdev->dev.kobj, &bcmbca_hsspi_group);
 	if (ret) {
 		dev_err(&pdev->dev, "couldn't register sysfs group\n");
-		goto out_pm_disable;
+		goto out_put_host;
 	}
 
 	/* register and we are done */
@@ -558,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_pm_disable:
-	pm_runtime_disable(&pdev->dev);
 out_put_host:
 	spi_controller_put(host);
 out_disable_pll_clk: