Re: [PATCH v3 3/3] Input: ads7846: Switch to devm initialization

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

 



Hi Marco!

On 5/19/20 11:18 AM, Marco Felsch wrote:
> On 20-05-07 08:20, Daniel Mack wrote:
>> This simplies the code a lot and fixes some potential resource leaks in
>> the error return paths.
>>
>> Signed-off-by: Daniel Mack <daniel@xxxxxxxxxx>
>> ---
>>  drivers/input/touchscreen/ads7846.c | 123 ++++++++++------------------
>>  1 file changed, 45 insertions(+), 78 deletions(-)
>>

>> @@ -1482,26 +1468,7 @@ static int ads7846_remove(struct spi_device *spi)
>>  	struct ads7846 *ts = spi_get_drvdata(spi);
>>  
>>  	sysfs_remove_group(&spi->dev.kobj, &ads784x_attr_group);
>> -
>>  	ads7846_disable(ts);
> 
> Did you tested the bind/unbind path? I think we are getting troubles
> here because ads7846_disable calls ads7846_stop() and
> regulator_disable(). Since we are using the devm_action the regualtor
> gets disabled by this action and ads7846_disable(). This causes a
> refcount problem.

Ah, nice catch. Yes, we just need to call ads7846_stop() here. Will post
a v4 then.


Thanks,
Daniel




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux