gpio: arizona: disable pm_runtime in case of failure
authorZheng Liang <zhengliang6@huawei.com>
Tue, 24 Nov 2020 03:06:06 +0000 (11:06 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 2 Dec 2020 09:40:54 +0000 (10:40 +0100)
pm_runtime_enable will increase power disable depth. Thus a
pairing decrement is needed on the error handling path to keep
it balanced.

Fixes:27a49ed17e224(gpio: arizona: Add support for GPIOs that)
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Liang <zhengliang6@huawei.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-arizona.c

index 5bda38e0780f24badccd5167c0db701b2e02640e..2bc173c352ce5aadde7142376c4931a4116bfcf8 100644 (file)
@@ -192,6 +192,7 @@ static int arizona_gpio_probe(struct platform_device *pdev)
        ret = devm_gpiochip_add_data(&pdev->dev, &arizona_gpio->gpio_chip,
                                     arizona_gpio);
        if (ret < 0) {
+               pm_runtime_disable(&pdev->dev);
                dev_err(&pdev->dev, "Could not register gpiochip, %d\n",
                        ret);
                return ret;