Skip to contentSkip to conversation

can: tcan45x: Fix inconsistent IS_ERR and PTR_ERR

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Dec 10, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: tcan45x: Fix inconsistent IS_ERR and PTR_ERR

Fix inconsistent IS_ERR and PTR_ERR in tcan4x5x_parse_config.

The proper pointer to be passed as argument is tcan4x5x->device_wake_gpio.

This bug was detected with the help of Coccinelle.

Fixes 2de497356955 ("can: tcan45x: Make wake-up GPIO an optional GPIO")
---
 drivers/net/can/m_can/tcan4x5x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/m_can/tcan4x5x.c +1 -1
index 4e1789ea2bc3..6676ecec48c3 100644
@@ -355,7 +355,7 @@ static int tcan4x5x_parse_config(struct m_can_classdev *cdev)
 	tcan4x5x->device_wake_gpio = devm_gpiod_get(cdev->dev, "device-wake",
 						    GPIOD_OUT_HIGH);
 	if (IS_ERR(tcan4x5x->device_wake_gpio)) {
-		if (PTR_ERR(tcan4x5x->power) == -EPROBE_DEFER)
+		if (PTR_ERR(tcan4x5x->device_wake_gpio) == -EPROBE_DEFER)
 			return -EPROBE_DEFER;
 
 		tcan4x5x_disable_wake(cdev);
Signature · 1 line
2.23.0
Acked-by on v1 1/1
#1 lore raw

Gustavo

Quoted 17 lines · Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in tcan4x5x_parse_config.

The proper pointer to be passed as argument is tcan4x5x->device_wake_gpio.

This bug was detected with the help of Coccinelle.

Fixes 2de497356955 ("can: tcan45x: Make wake-up GPIO an optional GPIO")
---
  drivers/net/can/m_can/tcan4x5x.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/m_can/tcan4x5x.c +0 -0
index 4e1789ea2bc3..6676ecec48c3 100644

drivers/net/can/m_can/tcan4x5x.c static int tcan4x5x_parse_config(struct m_can_classdev *cdev) · line 361

Quoted 8 lines
drivers/net/can/m_can/tcan4x5x.c +1 -1
@@ -355,7 +355,7 @@ static int tcan4x5x_parse_config(struct m_can_classdev *cdev)
  	tcan4x5x->device_wake_gpio = devm_gpiod_get(cdev->dev, "device-wake",
  						    GPIOD_OUT_HIGH);
  	if (IS_ERR(tcan4x5x->device_wake_gpio)) {
-		if (PTR_ERR(tcan4x5x->power) == -EPROBE_DEFER)
+		if (PTR_ERR(tcan4x5x->device_wake_gpio) == -EPROBE_DEFER)
  			return -EPROBE_DEFER;
 
  		tcan4x5x_disable_wake(cdev);
maintainer Applied
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 8 lines · Gustavo A. R. Silva

Fix inconsistent IS_ERR and PTR_ERR in tcan4x5x_parse_config.

The proper pointer to be passed as argument is tcan4x5x->device_wake_gpio.

This bug was detected with the help of Coccinelle.

Fixes 2de497356955 ("can: tcan45x: Make wake-up GPIO an optional GPIO")

Applied to linux-can.

Tnx,
Marc

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