* [PATCH] drivers: dma: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
@ 2022-04-11 1:35 cgel.zte
2022-04-11 10:50 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-11 1:35 UTC (permalink / raw)
To: sean.wang
Cc: vkoul, matthias.bgg, dmaengine, linux-arm-kernel, linux-mediatek,
linux-kernel, Minghao Chi, Zeal Robot
From: Minghao Chi <chi.minghao@zte.com.cn>
Using pm_runtime_resume_and_get is more appropriate
for simplifing code
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers: dma: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
2022-04-11 1:35 [PATCH] drivers: dma: using pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
@ 2022-04-11 10:50 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2022-04-11 10:50 UTC (permalink / raw)
To: cgel.zte
Cc: sean.wang, matthias.bgg, dmaengine, linux-arm-kernel,
linux-mediatek, linux-kernel, Minghao Chi, Zeal Robot
On 11-04-22, 01:35, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@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@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-11 10:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 1:35 [PATCH] drivers: dma: using pm_runtime_resume_and_get instead of pm_runtime_get_sync cgel.zte
2022-04-11 10:50 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).