linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: mcp251x: Fix regulators operation without CONFIG_REGULATOR
@ 2014-03-14  8:46 Alexander Shiyan
  2014-03-14  9:49 ` Marc Kleine-Budde
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Shiyan @ 2014-03-14  8:46 UTC (permalink / raw)
  To: linux-can; +Cc: Wolfgang Grandegger, Marc Kleine-Budde, Alexander Shiyan

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>
---
 drivers/net/can/mcp251x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index cdb9808..1b6acb1 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)
@@ -1221,7 +1221,7 @@ static int 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;
 	}
-- 
1.8.3.2


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

end of thread, other threads:[~2014-03-17  9:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-14  8:46 [PATCH] can: mcp251x: Fix regulators operation without CONFIG_REGULATOR Alexander Shiyan
2014-03-14  9:49 ` Marc Kleine-Budde
2014-03-14  9:55   ` Alexander Shiyan
2014-03-14  9:59     ` Marc Kleine-Budde
2014-03-14 10:11       ` Alexander Shiyan
2014-03-14 10:15         ` Marc Kleine-Budde
2014-03-17  7:07           ` Oliver Hartkopp
2014-03-17  9:37             ` Marc Kleine-Budde

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).