diff options
author | Srinivas Neeli <srinivas.neeli@xilinx.com> | 2021-04-09 16:08:05 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2021-06-14 20:20:38 +0200 |
commit | a51b2fb94b04ab71e53a71b9fad03fa826941254 (patch) | |
tree | 4f54b7347051278360e098f567600f09a8485d32 /drivers/gpio/gpio-zynq.c | |
parent | gpio: zynq: use module_platform_driver to simplify the code (diff) | |
download | linux-a51b2fb94b04ab71e53a71b9fad03fa826941254.tar.xz linux-a51b2fb94b04ab71e53a71b9fad03fa826941254.zip |
gpio: zynq: Check return value of pm_runtime_get_sync
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>
Diffstat (limited to 'drivers/gpio/gpio-zynq.c')
-rw-r--r-- | drivers/gpio/gpio-zynq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index bb1ac0c5cf26..c91302a16c77 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -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); |