]> git.baikalelectronics.ru Git - kernel.git/commitdiff
can: tcan4x5x: tcan4x5x_parse_config(): fix inconsistent IS_ERR and PTR_ERR
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 10 Dec 2019 15:05:32 +0000 (09:05 -0600)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 2 Jan 2020 14:34:26 +0000 (15:34 +0100)
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: c52ad193400d ("can: tcan45x: Make wake-up GPIO an optional GPIO")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/tcan4x5x.c

index a413e75485463e77020352cbdae8fccc7c60da6c..eacd428e07e9f32c9c014b877d0d0105d8b4ffc9 100644 (file)
@@ -387,7 +387,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);