diff mbox series

[-next] spi: bcm63xx: Fix missing pm_runtime_disable()

Message ID 20240819040310.2801422-1-ruanjinjie@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] spi: bcm63xx: Fix missing pm_runtime_disable() | expand

Commit Message

Jinjie Ruan Aug. 19, 2024, 4:03 a.m. UTC
The pm_runtime_disable() is missing in the remove function, add it to
align with the probe error path.

Fixes: 2d13f2ff6073 ("spi: bcm63xx-spi: fix pm_runtime")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/spi/spi-bcm63xx.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jonas Gorski Aug. 19, 2024, 7:52 a.m. UTC | #1
Hi,

On Mon, 19 Aug 2024 at 05:55, Jinjie Ruan <ruanjinjie@huawei.com> wrote:
>
> The pm_runtime_disable() is missing in the remove function, add it to
> align with the probe error path.
>
> Fixes: 2d13f2ff6073 ("spi: bcm63xx-spi: fix pm_runtime")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
>  drivers/spi/spi-bcm63xx.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
> index 289f8a94980b..0531b6f3eef3 100644
> --- a/drivers/spi/spi-bcm63xx.c
> +++ b/drivers/spi/spi-bcm63xx.c
> @@ -614,6 +614,8 @@ static void bcm63xx_spi_remove(struct platform_device *pdev)
>         /* reset spi block */
>         bcm_spi_writeb(bs, 0, SPI_INT_MASK);
>
> +       pm_runtime_disable(&pdev->dev);
> +

How about using devm_pm_runtime_enable() instead in the probe path?
Then we don't need to call _disable() manually.

>         /* HW shutdown */
>         clk_disable_unprepare(bs->clk);
>  }
> --
> 2.34.1
>

Best Regards,
Jonas Gorski
Jinjie Ruan Aug. 19, 2024, 8:07 a.m. UTC | #2
On 2024/8/19 15:52, Jonas Gorski wrote:
> Hi,
> 
> On Mon, 19 Aug 2024 at 05:55, Jinjie Ruan <ruanjinjie@huawei.com> wrote:
>>
>> The pm_runtime_disable() is missing in the remove function, add it to
>> align with the probe error path.
>>
>> Fixes: 2d13f2ff6073 ("spi: bcm63xx-spi: fix pm_runtime")
>> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
>> ---
>>  drivers/spi/spi-bcm63xx.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
>> index 289f8a94980b..0531b6f3eef3 100644
>> --- a/drivers/spi/spi-bcm63xx.c
>> +++ b/drivers/spi/spi-bcm63xx.c
>> @@ -614,6 +614,8 @@ static void bcm63xx_spi_remove(struct platform_device *pdev)
>>         /* reset spi block */
>>         bcm_spi_writeb(bs, 0, SPI_INT_MASK);
>>
>> +       pm_runtime_disable(&pdev->dev);
>> +
> 
> How about using devm_pm_runtime_enable() instead in the probe path?
> Then we don't need to call _disable() manually.

Hi, Jonas

I think that is good. I grep the commit log and there is a example:

https://lore.kernel.org/all/20240605131533.20037-2-raag.jadav@intel.com/

I'll change it to use devm_pm_runtime_enable() to fix it, thank you!

> 
>>         /* HW shutdown */
>>         clk_disable_unprepare(bs->clk);
>>  }
>> --
>> 2.34.1
>>
> 
> Best Regards,
> Jonas Gorski
diff mbox series

Patch

diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index 289f8a94980b..0531b6f3eef3 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -614,6 +614,8 @@  static void bcm63xx_spi_remove(struct platform_device *pdev)
 	/* reset spi block */
 	bcm_spi_writeb(bs, 0, SPI_INT_MASK);
 
+	pm_runtime_disable(&pdev->dev);
+
 	/* HW shutdown */
 	clk_disable_unprepare(bs->clk);
 }