Re: [PATCH] dma-mapping: Stub out dma_{alloc,free,map}_pages() API

From: James Clark
Date: Mon Jun 16 2025 - 09:23:57 EST




On 16/06/2025 2:19 pm, Christoph Hellwig wrote:
On Mon, Jun 16, 2025 at 02:15:56PM +0100, James Clark wrote:
Yes it does, it has a few modes that don't require it. Presumably we can't
just add a depends into the kconfig for all devices because they might not
be using DMA.

*for all the different variants of spi-fsl-dpsi devices I mean

This is drivers/spi/spi-fsl-dspi.c?

Yes, looks like it is one of those rare devices supporting a DMA and
non-DMA mode. But everything seems nicely guarded off using
"dspi->devtype_data->trans_mode == DSPI_DMA_MODE" checks there. So
wrap them into a little helper using IS_ENABLED(CONFIG_HAS_DMA) and
everything should be sorted out.

Sure, I don't mind doing it.

But separately to that, I still think making the stubs consistent would save people a lot of time diagnosing build failures if they switch existing code to any of those 3 functions. Principle of Least Astonishment and all that.