diff mbox series

[7/9] spi: s3c64xx: Use dma_request_chan() directly for channel request

Message ID 20191113094256.1108-8-peter.ujfalusi@ti.com (mailing list archive)
State Mainlined
Commit df1b0141788527c032a9851c0589a1712d7e46b8
Headers show
Series spi: Use dma_request_chan() directly for channel request | expand

Commit Message

Peter Ujfalusi Nov. 13, 2019, 9:42 a.m. UTC
dma_request_slave_channel_reason() is:
#define dma_request_slave_channel_reason(dev, name) \
	dma_request_chan(dev, name)

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/spi/spi-s3c64xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Andi Shyti Nov. 13, 2019, 11:40 p.m. UTC | #1
Hi Peter,

>  	if (!is_polling(sdd)) {
>  		/* Acquire DMA channels */
> -		sdd->rx_dma.ch = dma_request_slave_channel_reason(&pdev->dev,
> -								  "rx");
> +		sdd->rx_dma.ch = dma_request_chan(&pdev->dev, "rx");

I have a little concern here. We have two funcions
'dma_request_chan' and  'dma_request_channel' don't we end up
making some confusion here?

Wouldn't it make more sense renaming 'dma_request_chan' to
'dma_request_slave_channel_reason'?

Thanks,
Andi
Krzysztof Kozlowski Nov. 14, 2019, 6:27 a.m. UTC | #2
On Wed, 13 Nov 2019 at 17:42, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
>
> dma_request_slave_channel_reason() is:
> #define dma_request_slave_channel_reason(dev, name) \
>         dma_request_chan(dev, name)
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
>  drivers/spi/spi-s3c64xx.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
Peter Ujfalusi Nov. 14, 2019, 8:09 a.m. UTC | #3
On 14/11/2019 1.40, Andi Shyti wrote:
> Hi Peter,
> 
>>  	if (!is_polling(sdd)) {
>>  		/* Acquire DMA channels */
>> -		sdd->rx_dma.ch = dma_request_slave_channel_reason(&pdev->dev,
>> -								  "rx");
>> +		sdd->rx_dma.ch = dma_request_chan(&pdev->dev, "rx");
> 
> I have a little concern here. We have two funcions
> 'dma_request_chan' and  'dma_request_channel' don't we end up
> making some confusion here?
> 
> Wouldn't it make more sense renaming 'dma_request_chan' to
> 'dma_request_slave_channel_reason'?

The dma_request_channel() should go away. It was the old API before we
got the dma_slave_map for non DT (and non ACPI) platforms so we can get
rid of the filter function exports from DMA drivers to clients all over
the place.

I know there are users where they provide dummy filter function.

At the end the main API to request slave DMA channel should be
dma_request_chan()
For non slave channels (not HW triggered) we have dma_request_chan_by_mask()

Imoh the dma_request_slave_channel_compat() should also go away with time.

> 
> Thanks,
> Andi
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Andi Shyti Nov. 14, 2019, 9:12 a.m. UTC | #4
Hi Peter,

> >>  	if (!is_polling(sdd)) {
> >>  		/* Acquire DMA channels */
> >> -		sdd->rx_dma.ch = dma_request_slave_channel_reason(&pdev->dev,
> >> -								  "rx");
> >> +		sdd->rx_dma.ch = dma_request_chan(&pdev->dev, "rx");
> > 
> > I have a little concern here. We have two funcions
> > 'dma_request_chan' and  'dma_request_channel' don't we end up
> > making some confusion here?
> > 
> > Wouldn't it make more sense renaming 'dma_request_chan' to
> > 'dma_request_slave_channel_reason'?
> 
> The dma_request_channel() should go away. It was the old API before we
> got the dma_slave_map for non DT (and non ACPI) platforms so we can get
> rid of the filter function exports from DMA drivers to clients all over
> the place.

Yes, I agree... thanks!

Acked-by: Andi Shyti <andi@etezian.org>

Thanks,
Andi
diff mbox series

Patch

diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 7b7151ec14c8..cf67ea60dc0e 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1154,15 +1154,13 @@  static int s3c64xx_spi_probe(struct platform_device *pdev)
 
 	if (!is_polling(sdd)) {
 		/* Acquire DMA channels */
-		sdd->rx_dma.ch = dma_request_slave_channel_reason(&pdev->dev,
-								  "rx");
+		sdd->rx_dma.ch = dma_request_chan(&pdev->dev, "rx");
 		if (IS_ERR(sdd->rx_dma.ch)) {
 			dev_err(&pdev->dev, "Failed to get RX DMA channel\n");
 			ret = PTR_ERR(sdd->rx_dma.ch);
 			goto err_disable_io_clk;
 		}
-		sdd->tx_dma.ch = dma_request_slave_channel_reason(&pdev->dev,
-								  "tx");
+		sdd->tx_dma.ch = dma_request_chan(&pdev->dev, "tx");
 		if (IS_ERR(sdd->tx_dma.ch)) {
 			dev_err(&pdev->dev, "Failed to get TX DMA channel\n");
 			ret = PTR_ERR(sdd->tx_dma.ch);