Thread (6 messages) 6 messages, 3 authors, 18d ago

Re: [PATCH] ASoC: fsl_asrc: check the second front-end DMA channel

flat view

From: Slavin Liu <hidden>
Date: 2026-09-26 14:10:19
Also in: linux-sound, lkml

Hi Dan,

On Sat, Sep 26, 2026 at 04:19:38PM +0300, Dan Carpenter wrote:
The ->get_dma_channel() function pointer returns error pointers not
NULL.

    sound/soc/fsl/fsl_asrc_dma.c:254 fsl_asrc_dma_hw_params()
    warn: 'tmp_chan' is an error pointer or valid

sound/soc/fsl/fsl_easrc.c | (struct fsl_asrc)->get_dma_channel | fsl_easrc_get_dma_channel | 1
sound/soc/fsl/fsl_asrc.c | (struct fsl_asrc)->get_dma_channel | fsl_asrc_get_dma_channel | 1
Is this a false positive?: both implementations return
dma_request_slave_channel(), which is an inline wrapper converting the
ERR_PTR from dma_request_chan() to NULL before returning:

	static inline struct dma_chan * __deprecated
	dma_request_slave_channel(struct device *dev, const char *name)
	{
		struct dma_chan *ch = dma_request_chan(dev, name);

		return IS_ERR(ch) ? NULL : ch;
	}

So ->get_dma_channel() return NULL or a valid pointer.

The same function backs this up: the persistent Front-End channel a
few lines above comes from the same function pointer and is checked
with !pair->dma_chan[!dir], while the Back-End channel is requested
with dma_request_chan() directly and uses IS_ERR() -- the two check
styles in one function match the two APIs.

Best regards,
Slavin Liu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help