linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: touchscreen: ads7846 Remove redundant regulator_disable call
@ 2016-08-17 10:35 Petr Cvek
  2016-08-19 17:15 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Cvek @ 2016-08-17 10:35 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input

ADS7846 regulator is disabled twice in a row in ads7846_remove(). Valid
one is in ads7846_disable().

Removing the ads7846 module causes warning about unbalanced disables.

  ...
  WARNING: CPU: 0 PID: 29269 at drivers/regulator/core.c:2251 _regulator_disable+0xf8/0x130
  unbalanced disables for vads7846
  CPU: 0 PID: 29269 Comm: rmmod Tainted: G      D W       4.7.0+ #3
  Hardware name: HTC Magician
  ...
    show_stack+0x10/0x14
    __warn+0xd8/0x100
    warn_slowpath_fmt+0x38/0x48
    _regulator_disable+0xf8/0x130
    regulator_disable+0x34/0x60
    ads7846_remove+0x58/0xd4 [ads7846]
    spi_drv_remove+0x1c/0x34
    __device_release_driver+0x84/0x114
    driver_detach+0x8c/0x90
    bus_remove_driver+0x5c/0xc8
    SyS_delete_module+0x1a0/0x238
    ret_fast_syscall+0x0/0x38

Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
 drivers/input/touchscreen/ads7846.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index a61b215..1ce3ecb 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1473,7 +1473,6 @@ static int ads7846_remove(struct spi_device *spi)
 
 	ads784x_hwmon_unregister(spi, ts);
 
-	regulator_disable(ts->reg);
 	regulator_put(ts->reg);
 
 	if (!ts->get_pendown_state) {
-- 
2.9.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] input: touchscreen: ads7846 Remove redundant regulator_disable call
  2016-08-17 10:35 [PATCH] input: touchscreen: ads7846 Remove redundant regulator_disable call Petr Cvek
@ 2016-08-19 17:15 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2016-08-19 17:15 UTC (permalink / raw)
  To: Petr Cvek; +Cc: linux-input

On Wed, Aug 17, 2016 at 12:35:17PM +0200, Petr Cvek wrote:
> ADS7846 regulator is disabled twice in a row in ads7846_remove(). Valid
> one is in ads7846_disable().
> 
> Removing the ads7846 module causes warning about unbalanced disables.
> 
>   ...
>   WARNING: CPU: 0 PID: 29269 at drivers/regulator/core.c:2251 _regulator_disable+0xf8/0x130
>   unbalanced disables for vads7846
>   CPU: 0 PID: 29269 Comm: rmmod Tainted: G      D W       4.7.0+ #3
>   Hardware name: HTC Magician
>   ...
>     show_stack+0x10/0x14
>     __warn+0xd8/0x100
>     warn_slowpath_fmt+0x38/0x48
>     _regulator_disable+0xf8/0x130
>     regulator_disable+0x34/0x60
>     ads7846_remove+0x58/0xd4 [ads7846]
>     spi_drv_remove+0x1c/0x34
>     __device_release_driver+0x84/0x114
>     driver_detach+0x8c/0x90
>     bus_remove_driver+0x5c/0xc8
>     SyS_delete_module+0x1a0/0x238
>     ret_fast_syscall+0x0/0x38
> 
> Signed-off-by: Petr Cvek <petr.cvek@tul.cz>

Applied, thank you.

> ---
>  drivers/input/touchscreen/ads7846.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> index a61b215..1ce3ecb 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -1473,7 +1473,6 @@ static int ads7846_remove(struct spi_device *spi)
>  
>  	ads784x_hwmon_unregister(spi, ts);
>  
> -	regulator_disable(ts->reg);
>  	regulator_put(ts->reg);
>  
>  	if (!ts->get_pendown_state) {
> -- 
> 2.9.2
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-19 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-17 10:35 [PATCH] input: touchscreen: ads7846 Remove redundant regulator_disable call Petr Cvek
2016-08-19 17:15 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).