Re: [PATCH v3 2/2] iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms
From: Daniel Lezcano
Date: Thu Sep 18 2025 - 10:08:43 EST
Hi Christophe,
On 16/09/2025 22:53, Christophe JAILLET wrote:
[ ... ]
+static int nxp_sar_adc_dma_probe(struct device *dev, struct nxp_sar_adc *info)
+{
+ struct device *dev_dma;
+ u8 *rx_buf;
+
+ info->dma_chan = devm_dma_request_chan(dev, "rx");
+ if (IS_ERR(info->dma_chan))
+ return PTR_ERR(info->dma_chan);
+
+ dev_dma = info->dma_chan->device->dev;
+ rx_buf = dma_alloc_coherent(dev_dma, NXP_SAR_ADC_DMA_BUFF_SZ,
+ &info->rx_dma_buf, GFP_KERNEL);
maybe dmam_alloc_coherent() for the managed version?
This would save some LoC.
Ok, thanks for the suggestion, I'll do the change.
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog