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

dmaengine: ti: k3-udma-glue: Get the ringacc from udma_dev

If of_xudma_dev_get() returns with the valid udma_dev then the driver
already got the ringacc, there is no need to execute
of_k3_ringacc_get_by_phandle() for each channel via the glue layer.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Link: https://lore.kernel.org/r/20201208090440.31792-6-peter.ujfalusi@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Peter Ujfalusi and committed by
Vinod Koul
aa8a4c4e 426506a7

+8 -5
+1 -5
drivers/dma/ti/k3-udma-glue.c
··· 86 86 static int of_k3_udma_glue_parse(struct device_node *udmax_np, 87 87 struct k3_udma_glue_common *common) 88 88 { 89 - common->ringacc = of_k3_ringacc_get_by_phandle(udmax_np, 90 - "ti,ringacc"); 91 - if (IS_ERR(common->ringacc)) 92 - return PTR_ERR(common->ringacc); 93 - 94 89 common->udmax = of_xudma_dev_get(udmax_np, NULL); 95 90 if (IS_ERR(common->udmax)) 96 91 return PTR_ERR(common->udmax); 97 92 93 + common->ringacc = xudma_get_ringacc(common->udmax); 98 94 common->tisci_rm = xudma_dev_get_tisci_rm(common->udmax); 99 95 100 96 return 0;
+6
drivers/dma/ti/k3-udma-private.c
··· 56 56 } 57 57 EXPORT_SYMBOL(xudma_get_device); 58 58 59 + struct k3_ringacc *xudma_get_ringacc(struct udma_dev *ud) 60 + { 61 + return ud->ringacc; 62 + } 63 + EXPORT_SYMBOL(xudma_get_ringacc); 64 + 59 65 u32 xudma_dev_get_psil_base(struct udma_dev *ud) 60 66 { 61 67 return ud->psil_base;
+1
drivers/dma/ti/k3-udma.h
··· 113 113 114 114 struct udma_dev *of_xudma_dev_get(struct device_node *np, const char *property); 115 115 struct device *xudma_get_device(struct udma_dev *ud); 116 + struct k3_ringacc *xudma_get_ringacc(struct udma_dev *ud); 116 117 void xudma_dev_put(struct udma_dev *ud); 117 118 u32 xudma_dev_get_psil_base(struct udma_dev *ud); 118 119 struct udma_tisci_rm *xudma_dev_get_tisci_rm(struct udma_dev *ud);