Skip to contentSkip to conversation

can: mcp251x: Fix regulators operation without CONFIG_REGULATOR

PATCH In review Alexander Shiyan 3 participants 8 messages Mar 14, 2014 – Mar 17, 2014 CAN network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/net/can/mcp251x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/can/mcp251x.c +2 -2
index cdb9808..1b6acb1 100644
@@ -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;
 	}
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 4 lines · Alexander Shiyan

If CONFIG_REGULATOR is not set, devm_regulator_get() returns NULL, so use IS_ERR_OR_NULL() macro for checks.

This should probably go into net, right?

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#2 lore raw

Пятница, 14 марта 2014, 10:49 +01:00 от Marc Kleine-Budde <[email protected]>:

Quoted 7 lines · Alexander Shiyan
Quoted 4 lines

If CONFIG_REGULATOR is not set, devm_regulator_get() returns NULL, so use IS_ERR_OR_NULL() macro for checks.

This should probably go into net, right?

net/can? I usually use the tag "can". Something wrong?

---

#3 lore raw
Quoted 8 lines · Alexander Shiyan

Пятница, 14 марта 2014, 10:49 +01:00 от Marc Kleine-Budde <[email protected]>:

Quoted 7 lines · Alexander Shiyan
Quoted 4 lines

If CONFIG_REGULATOR is not set, devm_regulator_get() returns NULL, so use IS_ERR_OR_NULL() macro for checks.

This should probably go into net, right?

I mean this is a patch for David Miller's net tree, not for net-next.

Quoted 1 line

net/can? I usually use the tag "can". Something wrong?

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#4 lore raw

Пятница, 14 марта 2014, 10:59 +01:00 от Marc Kleine-Budde <[email protected]>:

Quoted 11 lines · Alexander Shiyan
Quoted 8 lines

Пятница, 14 марта 2014, 10:49 +01:00 от Marc Kleine-Budde <[email protected]>:

Quoted 7 lines · Alexander Shiyan
Quoted 4 lines

If CONFIG_REGULATOR is not set, devm_regulator_get() returns NULL, so use IS_ERR_OR_NULL() macro for checks.

This should probably go into net, right?

I mean this is a patch for David Miller's net tree, not for net-next.

This is not a critical patch, patch just makes the right checks.

---

#5 lore raw
Quoted 7 lines · Alexander Shiyan

Пятница, 14 марта 2014, 10:59 +01:00 от Marc Kleine-Budde <[email protected]>:

Quoted 6 lines · Alexander Shiyan
Quoted 5 lines

Пятница, 14 марта 2014, 10:49 +01:00 от Marc Kleine-Budde <[email protected]>:

Quoted 4 lines · Alexander Shiyan
Quoted 3 lines

If CONFIG_REGULATOR is not set, devm_regulator_get() returns NULL, so use IS_ERR_OR_NULL() macro for checks.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

This should probably go into net, right?

I mean this is a patch for David Miller's net tree, not for net-next.

This is not a critical patch, patch just makes the right checks.

Okay, applied to can-next, that goes via net-next into v3.15.

Thanks,
Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#6 lore raw
Quoted 3 lines · Marc Kleine-Budde

Okay, applied to can-next, that goes via net-next into v3.15.

Hello Marc,

Linus just tagged 3.14-rc7 with a relaxed comment:

	https://lkml.org/lkml/2014/3/16/166

So net-next might close this week.

Just FYI :-)

Regards,
Oliver

#7 lore raw
Quoted 8 lines · Oliver Hartkopp
Quoted 3 lines · Marc Kleine-Budde

Okay, applied to can-next, that goes via net-next into v3.15.

Hello Marc,

Quoted 7 lines

Linus just tagged 3.14-rc7 with a relaxed comment:

	https://lkml.org/lkml/2014/3/16/166

So net-next might close this week.

Just FYI :-)

Done, pull-request sent :)

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |