summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/mcp251x.c
diff options
context:
space:
mode:
authorAlexander Shiyan2014-03-14 09:46:20 +0100
committerMarc Kleine-Budde2014-03-17 09:20:17 +0100
commit76aeec83e448478838eec868066dda33049d1288 (patch)
tree2210e0cf43d823054b1104b71a9db4058004619b /drivers/net/can/mcp251x.c
parentcan: populate netdev::dev_id for udev discrimination (diff)
downloadkernel-qcow2-linux-76aeec83e448478838eec868066dda33049d1288.tar.gz
kernel-qcow2-linux-76aeec83e448478838eec868066dda33049d1288.tar.xz
kernel-qcow2-linux-76aeec83e448478838eec868066dda33049d1288.zip
can: mcp251x: Fix regulators operation without CONFIG_REGULATOR
If CONFIG_REGULATOR is not set, devm_regulator_get() returns NULL, so use IS_ERR_OR_NULL() macro for checks. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/mcp251x.c')
-rw-r--r--drivers/net/can/mcp251x.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index a8b74f8da03d..28c11f815245 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -672,7 +672,7 @@ static int mcp251x_hw_probe(struct spi_device *spi)
static int mcp251x_power_enable(struct regulator *reg, int enable)
{
- if (IS_ERR(reg))
+ if (IS_ERR_OR_NULL(reg))
return 0;
if (enable)
@@ -1218,7 +1218,7 @@ static int __maybe_unused mcp251x_can_suspend(struct device *dev)
priv->after_suspend = AFTER_SUSPEND_DOWN;
}
- if (!IS_ERR(priv->power)) {
+ if (!IS_ERR_OR_NULL(priv->power)) {
regulator_disable(priv->power);
priv->after_suspend |= AFTER_SUSPEND_POWER;
}