[PATCH] drivers: dma: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
Vinod Koul
vkoul at kernel.org
Mon Apr 11 03:50:37 PDT 2022
On 11-04-22, 01:35, cgel.zte at gmail.com wrote:
> From: Minghao Chi <chi.minghao at zte.com.cn>
subsystem tag is wrong, pls see gitlog to find the appropriate one
>
> Using pm_runtime_resume_and_get is more appropriate
> for simplifing code
Can you explain why it is appropriate?
>
> Reported-by: Zeal Robot <zealci at zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao at zte.com.cn>
> ---
> drivers/dma/mediatek/mtk-uart-apdma.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/dma/mediatek/mtk-uart-apdma.c b/drivers/dma/mediatek/mtk-uart-apdma.c
> index 375e7e647df6..64bad5681447 100644
> --- a/drivers/dma/mediatek/mtk-uart-apdma.c
> +++ b/drivers/dma/mediatek/mtk-uart-apdma.c
> @@ -274,11 +274,9 @@ static int mtk_uart_apdma_alloc_chan_resources(struct dma_chan *chan)
> unsigned int status;
> int ret;
>
> - ret = pm_runtime_get_sync(mtkd->ddev.dev);
> - if (ret < 0) {
> - pm_runtime_put_noidle(chan->device->dev);
> + ret = pm_runtime_resume_and_get(mtkd->ddev.dev);
> + if (ret < 0)
> return ret;
> - }
>
> mtk_uart_apdma_write(c, VFF_ADDR, 0);
> mtk_uart_apdma_write(c, VFF_THRE, 0);
> --
> 2.25.1
--
~Vinod
More information about the Linux-mediatek
mailing list