Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: zynqmp_dma: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()

pm_runtime_resume_and_get() automatically handle dev->power.usage_count
decrement on errors, so prefer using it and also implement it's error
handling.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Link: https://lore.kernel.org/r/1652166762-18317-4-git-send-email-radhey.shyam.pandey@xilinx.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Radhey Shyam Pandey and committed by
Vinod Koul
517a710a 9126518e

+5 -1
+5 -1
drivers/dma/xilinx/zynqmp_dma.c
··· 1078 1078 pm_runtime_set_autosuspend_delay(zdev->dev, ZDMA_PM_TIMEOUT); 1079 1079 pm_runtime_use_autosuspend(zdev->dev); 1080 1080 pm_runtime_enable(zdev->dev); 1081 - pm_runtime_get_sync(zdev->dev); 1081 + ret = pm_runtime_resume_and_get(zdev->dev); 1082 + if (ret < 0) { 1083 + dev_err(&pdev->dev, "device wakeup failed.\n"); 1084 + pm_runtime_disable(zdev->dev); 1085 + } 1082 1086 if (!pm_runtime_enabled(zdev->dev)) { 1083 1087 ret = zynqmp_dma_runtime_resume(zdev->dev); 1084 1088 if (ret)