can: tcan45x: Fix inconsistent IS_ERR and PTR_ERR
Subsystems (4)
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.
--- drivers/net/can/m_can/tcan4x5x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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);
Signature · 1 line
2.23.0
Gustavo
Quoted 17 lines · Gustavo A. R. Silva
Fix inconsistent
IS_ERRandPTR_ERRintcan4x5x_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")Signed-off-by Gustavo A. R. Silva <[email protected]>--- drivers/net/can/m_can/tcan4x5x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/can/m_can/tcan4x5x.c +0
-0
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);
Quoted 8 lines · Gustavo A. R. Silva
Fix inconsistent
IS_ERRandPTR_ERRintcan4x5x_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")Signed-off-by Gustavo A. R. Silva <[email protected]>
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 |