Re: [PATCH 04/15] i2c: busses: exynos5: Use devm_clk_get_enabled()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23/06/2023 13:48, Andi Shyti wrote:
> On Fri, Jun 23, 2023 at 12:03:56PM +0200, Wolfram Sang wrote:
>>
>>> -	clk_unprepare(i2c->clk);
>>> -	clk_unprepare(i2c->pclk);
>>
>> Are you sure we can use devm_clk_get_enabled() here which calls
>> clk_disable_unprepare() on remove and not clk_unprepare()?
> 
> Unless I am missing something, I think so. This is what the
> driver does, gets the clock and enables it.
> 
> I don't know why there is just unprepare() and not
> disable_unprepare() in this function.

Your code is not equivalent and does not explain why. Pure
devm_clk_get_enabled() conversion should be equivalent.

If original code was correct, your patch will cause double clk disable.
If original code was not correct, your patch silently fixes it without
explaining that there was a bug.

Did you test the patch, including the unbind path?

Best regards,
Krzysztof




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux