Re: [PATCH 2/4] iio: adc: ina2xx: Setup better name then simple ina2xx

From: Michal Simek
Date: Wed Aug 21 2019 - 04:37:07 EST


On 21. 08. 19 4:10, Phil Reid wrote:
> On 20/08/2019 22:11, Michal Simek wrote:
>> On systems with multiple ina2xx chips it is impossible to find out which
>> iio device is which one based on probe order. That's why it is
>> necessary to
>> setup better name based on possition.
>> The patch is reusing dev_name which is setup by core with client->name.
>>
>> name char array was setup to 128 byte length to correspond the same name
>> length by HID device.
>>
>> Before this patch:
>> iio:device9: ina226 (buffer capable)
>> After:
>> iio:device9: ina226-3-004a (buffer capable)
>
> Could this break existing user space code that's just looking for just
> ina226.
> I2c bus numbers aren't all that great at id'ing devices either. It's
> better than
> nothing but depending on what cards we have plugged into our system the
> same device gets
> a different bus number.

Fair point. Let's wait what dt guys say about label property.
I can simply drop this patch and use just this.

indio_dev->name = of_get_property(np, "label", NULL) ? : id->name;

Thanks,
Michal