Re: [PATCH v2 2/2] iio: adc: ti-ads112c14: add gpio support
From: David Lechner
Date: Sat Oct 10 2026 - 09:49:59 EST
On 10/10/26 4:00 AM, Bartosz Golaszewski wrote:
> On Sat, 10 Oct 2026 01:25:52 +0200, "David Lechner (TI)"
> <dlechner@xxxxxxxxxxxx> said:
>> Add support for using the AIN4/GPIO0 to AIN7/GPIO3 pins as GPIOs when
>> the gpio-controller property is present.
>>
...
>> @@ -2574,6 +2726,12 @@ static int ads112c14_probe(struct i2c_client *client)
>> if (ret)
>> return ret;
>>
>> + if (device_property_read_bool(dev, "gpio-controller")) {
>
> I think the right one to use is device_property_present().
I thought this was the one case where device_property_read_bool() is
actually correct because gpio-controller property is a
/schemas/types.yaml#/definitions/flag.
Otherwise, we should just remove device_property_read_bool() from the tree
because there would never be a reason to use it.
My understanding is we should use device_property_present() for non-boolean
properties when we want to know if it is present or not before reading the
value of it.
>
>> + ret = ads112c14_gpio_init(indio_dev);
>> + if (ret)
>> + return ret;
>> + }
>> +
>> return devm_iio_device_register(dev, indio_dev);
>> }
>>
>>
>> --
>> 2.53.0
>>
>>
>
> Bart