input: touch: raydium:fix warnings during shutdown
Jordan Nien [Thu, 24 Mar 2016 03:48:33 +0000 (11:48 +0800)]
skip regulator_disable() if already disabled in
shutdown path.

Bug 200184433

Change-Id: Ic3217687a412f88c450cddd3337c725075fece07
Signed-off-by: Jordan Nien <jnien@nvidia.com>
Reviewed-on: http://git-master/r/1114775
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: David Pu <dpu@nvidia.com>
Reviewed-by: Eric Chuang <echuang@nvidia.com>

drivers/input/touchscreen/rm31080a_ts.c

index 0a200e9..d9bc0d8 100644 (file)
@@ -3898,10 +3898,12 @@ static void rm_tch_spi_shutdown(struct spi_device *spi)
 
        free_irq(ts->irq, ts);
 
-       if (ts->regulator_3v3 && ts->regulator_1v8) {
+       if (ts->regulator_3v3 &&
+                       regulator_is_enabled(ts->regulator_3v3))
                regulator_disable(ts->regulator_3v3);
+       if (ts->regulator_1v8 &&
+               regulator_is_enabled(ts->regulator_1v8))
                regulator_disable(ts->regulator_1v8);
-       }
 }
 
 static int rm_tch_spi_remove(struct spi_device *spi)