diff mbox series

[-next] mtd: st_spi_fsm: add missing clk_disable_unprepare() stfsm_remove()

Message ID 20220513100322.2664431-1-yangyingliang@huawei.com
State Changes Requested
Headers show
Series [-next] mtd: st_spi_fsm: add missing clk_disable_unprepare() stfsm_remove() | expand

Commit Message

Yang Yingliang May 13, 2022, 10:03 a.m. UTC
Clock source is prepared and enabled by clk_prepare_enable()
in probe function, but no disable or unprepare in remove function.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/mtd/devices/st_spi_fsm.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Miquel Raynal May 13, 2022, 10:22 a.m. UTC | #1
Hi,

yangyingliang@huawei.com wrote on Fri, 13 May 2022 18:03:22 +0800:

> Clock source is prepared and enabled by clk_prepare_enable()
> in probe function, but no disable or unprepare in remove function.

			 not disabled or unprepared

Otherwise looks good.

> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/mtd/devices/st_spi_fsm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
> index 983999c020d6..d3377b10fc0f 100644
> --- a/drivers/mtd/devices/st_spi_fsm.c
> +++ b/drivers/mtd/devices/st_spi_fsm.c
> @@ -2126,6 +2126,8 @@ static int stfsm_remove(struct platform_device *pdev)
>  {
>  	struct stfsm *fsm = platform_get_drvdata(pdev);
>  
> +	clk_disable_unprepare(fsm->clk);
> +
>  	return mtd_device_unregister(&fsm->mtd);
>  }
>  


Thanks,
Miquèl
Yang Yingliang May 14, 2022, 2:12 a.m. UTC | #2
Hi,

On 2022/5/13 18:22, Miquel Raynal wrote:
> Hi,
>
> yangyingliang@huawei.com wrote on Fri, 13 May 2022 18:03:22 +0800:
>
>> Clock source is prepared and enabled by clk_prepare_enable()
>> in probe function, but no disable or unprepare in remove function.
> 			 not disabled or unprepared
>
> Otherwise looks good.
Do I need to resend it ?

Thanks,
Yang
>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>>   drivers/mtd/devices/st_spi_fsm.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
>> index 983999c020d6..d3377b10fc0f 100644
>> --- a/drivers/mtd/devices/st_spi_fsm.c
>> +++ b/drivers/mtd/devices/st_spi_fsm.c
>> @@ -2126,6 +2126,8 @@ static int stfsm_remove(struct platform_device *pdev)
>>   {
>>   	struct stfsm *fsm = platform_get_drvdata(pdev);
>>   
>> +	clk_disable_unprepare(fsm->clk);
>> +
>>   	return mtd_device_unregister(&fsm->mtd);
>>   }
>>   
>
> Thanks,
> Miquèl
> .
Miquel Raynal May 16, 2022, 7:51 a.m. UTC | #3
Hello,

yangyingliang@huawei.com wrote on Sat, 14 May 2022 10:12:55 +0800:

> Hi,
> 
> On 2022/5/13 18:22, Miquel Raynal wrote:
> > Hi,
> >
> > yangyingliang@huawei.com wrote on Fri, 13 May 2022 18:03:22 +0800:
> >  
> >> Clock source is prepared and enabled by clk_prepare_enable()
> >> in probe function, but no disable or unprepare in remove function.  
> > 			 not disabled or unprepared
> >
> > Otherwise looks good.  
> Do I need to resend it ?

Yes, please.

Thanks,
Miquèl
diff mbox series

Patch

diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c
index 983999c020d6..d3377b10fc0f 100644
--- a/drivers/mtd/devices/st_spi_fsm.c
+++ b/drivers/mtd/devices/st_spi_fsm.c
@@ -2126,6 +2126,8 @@  static int stfsm_remove(struct platform_device *pdev)
 {
 	struct stfsm *fsm = platform_get_drvdata(pdev);
 
+	clk_disable_unprepare(fsm->clk);
+
 	return mtd_device_unregister(&fsm->mtd);
 }