can: mcp251x: Call wrapper instead of regulator_disable()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 26 Aug 2019 17:26:23 +0000 (20:26 +0300)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 3 Sep 2019 08:23:57 +0000 (10:23 +0200)
There is no need to check for regulator presence in the ->suspend()
since a wrapper does it for us. Due to this we may unconditionally set
AFTER_SUSPEND_POWER flag.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251x.c

index e088549..bee9f7b 100644 (file)
@@ -1142,10 +1142,8 @@ static int __maybe_unused mcp251x_can_suspend(struct device *dev)
                priv->after_suspend = AFTER_SUSPEND_DOWN;
        }
 
-       if (!IS_ERR_OR_NULL(priv->power)) {
-               regulator_disable(priv->power);
-               priv->after_suspend |= AFTER_SUSPEND_POWER;
-       }
+       mcp251x_power_enable(priv->power, 0);
+       priv->after_suspend |= AFTER_SUSPEND_POWER;
 
        return 0;
 }