gpio: zynq: Check return value of pm_runtime_get_sync
authorSrinivas Neeli <srinivas.neeli@xilinx.com>
Fri, 9 Apr 2021 14:08:05 +0000 (19:38 +0530)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 14 Jun 2021 18:20:38 +0000 (20:20 +0200)
Return value of "pm_runtime_get_sync" API was neither captured nor checked.
Fixed it by capturing the return value and then checking for any warning.

Addresses-Coverity: "check_return"
Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-zynq.c

index bb1ac0c..c91302a 100644 (file)
@@ -1001,8 +1001,11 @@ err_pm_dis:
 static int zynq_gpio_remove(struct platform_device *pdev)
 {
        struct zynq_gpio *gpio = platform_get_drvdata(pdev);
+       int ret;
 
-       pm_runtime_get_sync(&pdev->dev);
+       ret = pm_runtime_get_sync(&pdev->dev);
+       if (ret < 0)
+               dev_warn(&pdev->dev, "pm_runtime_get_sync() Failed\n");
        gpiochip_remove(&gpio->chip);
        clk_disable_unprepare(gpio->clk);
        device_set_wakeup_capable(&pdev->dev, 0);