Re: [PATCH v3 4/6] iio: adc: xilinx-xadc: Add .setup_channels() to struct xadc_ops
From: David Lechner
Date: Sat Aug 01 2026 - 12:49:14 EST
On 8/1/26 11:47 AM, David Lechner wrote:
> On 7/29/26 7:54 AM, Dileep Kumar Nagavarapu wrote:
>> Add .setup_channels() function pointer to struct xadc_ops to enable
>> different interfaces to have custom channel setup logic.
>>
>> Co-developed-by: Sai Krishna Potthuri <sai.krishna.potthuri@xxxxxxx>
>> Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri@xxxxxxx>
>> Signed-off-by: Dileep Kumar Nagavarapu <DileepKumar.Nagavarapu@xxxxxxx>
>> ---
>> drivers/iio/adc/xilinx-xadc-core.c | 6 ++++--
>> drivers/iio/adc/xilinx-xadc-platform.c | 3 +++
>> drivers/iio/adc/xilinx-xadc.h | 2 ++
>> 3 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
>> index e3b1d5bebe98..d39ff54439ba 100644
>> --- a/drivers/iio/adc/xilinx-xadc-core.c
>> +++ b/drivers/iio/adc/xilinx-xadc-core.c
>> @@ -656,7 +656,7 @@ static const struct iio_info xadc_info = {
>> .update_scan_mode = &xadc_update_scan_mode,
>> };
>>
>> -static int xadc_parse_dt(struct iio_dev *indio_dev, unsigned int *conf, int irq)
>> +int xadc_parse_dt(struct iio_dev *indio_dev, unsigned int *conf, int irq)
>> {
>> struct device *dev = indio_dev->dev.parent;
>> struct xadc *xadc = iio_priv(indio_dev);
>> @@ -762,6 +762,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, unsigned int *conf, int irq)
>>
>> return 0;
>> }
>> +EXPORT_SYMBOL_NS_GPL(xadc_parse_dt, "IIO_XADC");
>
> This function is only used once. Would be better to just move
> it to the file that uses it instead of making a public function.
>
OK, maybe it is used in another file in a later patch. The commit
message here should explain that.