Re: [PATCH] iio: adc: ti-ads112c14: add gpio support
From: Andy Shevchenko
Date: Thu Oct 15 2026 - 09:31:19 EST
On Thu, Oct 15, 2026 at 08:00:04AM -0500, David Lechner wrote:
> On 10/13/26 9:03 AM, Andy Shevchenko wrote:
> > On Fri, Oct 09, 2026 at 06:04:21PM -0500, David Lechner wrote:
> >> On 9/28/26 3:36 AM, Andy Shevchenko wrote:
> >>> On Fri, Sep 25, 2026 at 04:50:47PM -0500, David Lechner (TI) wrote:
...
> >>>> +static int ads112c14_gpio_init(struct iio_dev *indio_dev)
> >>>> +{
> >>>> + struct ads112c14_data *data = iio_priv(indio_dev);
> >>>> + struct device *dev = indio_dev->dev.parent;
> >>>> +
> >>>> + for (unsigned int i = 0; i < ADS112C14_NUM_GPIO; i++) {
> >>>> + data->gpio_names[i] = devm_kasprintf(dev, GFP_KERNEL, "%s:GPIO%u",
> >>>> + dev_name(&indio_dev->dev), i);
> >>>> + if (!data->gpio_names[i])
> >>>> + return -ENOMEM;
> >>>
> >>> Wondering if you can utilise devm_kasprintf_strarray().
> >>>
> >> That uses "%s-%zu" internally, so would add a "-" where I don't want it.
> >
> > What's the problem with a dash?
>
> I want to match the datasheet pin name.
I see. Sounds like we might need something more universal for
devm_kasprintf_strarray(). (Yeah, I understand that that is out
of the scope of your series.)
--
With Best Regards,
Andy Shevchenko