diff mbox series

[v2,6/9] iio: adc: ad7173: Add ad7173_device_info names

Message ID 20240514-ad4111-v2-6-29be6a55efb5@analog.com (mailing list archive)
State Changes Requested
Headers show
Series Add support for AD411x | expand

Commit Message

Dumitru Ceclan via B4 Relay May 14, 2024, 7:22 a.m. UTC
From: Dumitru Ceclan <dumitru.ceclan@analog.com>

Add missing names from the device info struct for 3 models to ensure
consistency with the rest of the models.

Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
---
 drivers/iio/adc/ad7173.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

David Lechner May 15, 2024, 11:32 p.m. UTC | #1
On Tue, May 14, 2024 at 2:23 AM Dumitru Ceclan via B4 Relay
<devnull+dumitru.ceclan.analog.com@kernel.org> wrote:
>
> From: Dumitru Ceclan <dumitru.ceclan@analog.com>
>
> Add missing names from the device info struct for 3 models to ensure
> consistency with the rest of the models.
>

This affects userspace, right? So probably needs a Fixes: to make sure
this gets into the 6.10 release?

> Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
> ---
>  drivers/iio/adc/ad7173.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
> index 1e9ba3070770..d965b66d4d5a 100644
> --- a/drivers/iio/adc/ad7173.c
> +++ b/drivers/iio/adc/ad7173.c
> @@ -227,6 +227,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
>                 .num_sinc5_data_rates = ARRAY_SIZE(ad7173_sinc5_data_rates),
>         },
>         [ID_AD7172_4] = {
> +               .name = "ad7172-4",
>                 .id = AD7172_4_ID,
>                 .num_inputs = 9,
>                 .num_channels = 8,
> @@ -272,6 +273,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
>                 .num_sinc5_data_rates = ARRAY_SIZE(ad7175_sinc5_data_rates),
>         },
>         [ID_AD7175_8] = {
> +               .name = "ad7175-8",
>                 .id = AD7175_8_ID,
>                 .num_inputs = 17,
>                 .num_channels = 16,
> @@ -302,6 +304,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
>                 .num_sinc5_data_rates = ARRAY_SIZE(ad7175_sinc5_data_rates),
>         },
>         [ID_AD7177_2] = {
> +               .name = "ad7177-2",
>                 .id = AD7177_ID,
>                 .num_inputs = 5,
>                 .num_channels = 4,
>
> --
> 2.43.0
>
>
Ceclan, Dumitru May 16, 2024, 4:09 p.m. UTC | #2
On 16/05/2024 02:32, David Lechner wrote:
> On Tue, May 14, 2024 at 2:23 AM Dumitru Ceclan via B4 Relay
> <devnull+dumitru.ceclan.analog.com@kernel.org> wrote:
>>
>> From: Dumitru Ceclan <dumitru.ceclan@analog.com>
>>
>> Add missing names from the device info struct for 3 models to ensure
>> consistency with the rest of the models.
>>
> 
> This affects userspace, right? So probably needs a Fixes: to make sure
> this gets into the 6.10 release?
> 
I don't think that it breaks userspace, just creates an additional file.

This creates the file "name" in the iio:deviceX directory that reads the
string. I do not consider the Fixes: tag a necessity. I consider that it
resolves inconsistencies in the _device_info struct. 
>> Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
>> ---
>>  drivers/iio/adc/ad7173.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
>> index 1e9ba3070770..d965b66d4d5a 100644
>> --- a/drivers/iio/adc/ad7173.c
>> +++ b/drivers/iio/adc/ad7173.c
>> @@ -227,6 +227,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
>>                 .num_sinc5_data_rates = ARRAY_SIZE(ad7173_sinc5_data_rates),
>>         },
>>         [ID_AD7172_4] = {
>> +               .name = "ad7172-4",
>>                 .id = AD7172_4_ID,
>>                 .num_inputs = 9,
>>                 .num_channels = 8,
>> @@ -272,6 +273,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
>>                 .num_sinc5_data_rates = ARRAY_SIZE(ad7175_sinc5_data_rates),
>>         },
>>         [ID_AD7175_8] = {
>> +               .name = "ad7175-8",
>>                 .id = AD7175_8_ID,
>>                 .num_inputs = 17,
>>                 .num_channels = 16,
>> @@ -302,6 +304,7 @@ static const struct ad7173_device_info ad7173_device_info[] = {
>>                 .num_sinc5_data_rates = ARRAY_SIZE(ad7175_sinc5_data_rates),
>>         },
>>         [ID_AD7177_2] = {
>> +               .name = "ad7177-2",
>>                 .id = AD7177_ID,
>>                 .num_inputs = 5,
>>                 .num_channels = 4,
>>
>> --
>> 2.43.0
>>
>>
David Lechner May 16, 2024, 4:43 p.m. UTC | #3
On Thu, May 16, 2024 at 11:09 AM Ceclan, Dumitru
<mitrutzceclan@gmail.com> wrote:
>
> On 16/05/2024 02:32, David Lechner wrote:
> > On Tue, May 14, 2024 at 2:23 AM Dumitru Ceclan via B4 Relay
> > <devnull+dumitru.ceclan.analog.com@kernel.org> wrote:
> >>
> >> From: Dumitru Ceclan <dumitru.ceclan@analog.com>
> >>
> >> Add missing names from the device info struct for 3 models to ensure
> >> consistency with the rest of the models.
> >>
> >
> > This affects userspace, right? So probably needs a Fixes: to make sure
> > this gets into the 6.10 release?
> >
> I don't think that it breaks userspace, just creates an additional file.
>
> This creates the file "name" in the iio:deviceX directory that reads the
> string. I do not consider the Fixes: tag a necessity. I consider that it
> resolves inconsistencies in the _device_info struct.

Ah, OK. For some reason, I was thinking that it would default to the
driver name if this was left out.
Jonathan Cameron May 19, 2024, 5:09 p.m. UTC | #4
On Thu, 16 May 2024 11:43:17 -0500
David Lechner <dlechner@baylibre.com> wrote:

> On Thu, May 16, 2024 at 11:09 AM Ceclan, Dumitru
> <mitrutzceclan@gmail.com> wrote:
> >
> > On 16/05/2024 02:32, David Lechner wrote:  
> > > On Tue, May 14, 2024 at 2:23 AM Dumitru Ceclan via B4 Relay
> > > <devnull+dumitru.ceclan.analog.com@kernel.org> wrote:  
> > >>
> > >> From: Dumitru Ceclan <dumitru.ceclan@analog.com>
> > >>
> > >> Add missing names from the device info struct for 3 models to ensure
> > >> consistency with the rest of the models.
> > >>  
> > >
> > > This affects userspace, right? So probably needs a Fixes: to make sure
> > > this gets into the 6.10 release?
> > >  
> > I don't think that it breaks userspace, just creates an additional file.
> >
> > This creates the file "name" in the iio:deviceX directory that reads the
> > string. I do not consider the Fixes: tag a necessity. I consider that it
> > resolves inconsistencies in the _device_info struct.  
> 
> Ah, OK. For some reason, I was thinking that it would default to the
> driver name if this was left out.

Hmm. I'd be tempted to take this a fix as some userspace code relies
on that name being present and it is unusual to not see it.

Jonathan
diff mbox series

Patch

diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c
index 1e9ba3070770..d965b66d4d5a 100644
--- a/drivers/iio/adc/ad7173.c
+++ b/drivers/iio/adc/ad7173.c
@@ -227,6 +227,7 @@  static const struct ad7173_device_info ad7173_device_info[] = {
 		.num_sinc5_data_rates = ARRAY_SIZE(ad7173_sinc5_data_rates),
 	},
 	[ID_AD7172_4] = {
+		.name = "ad7172-4",
 		.id = AD7172_4_ID,
 		.num_inputs = 9,
 		.num_channels = 8,
@@ -272,6 +273,7 @@  static const struct ad7173_device_info ad7173_device_info[] = {
 		.num_sinc5_data_rates = ARRAY_SIZE(ad7175_sinc5_data_rates),
 	},
 	[ID_AD7175_8] = {
+		.name = "ad7175-8",
 		.id = AD7175_8_ID,
 		.num_inputs = 17,
 		.num_channels = 16,
@@ -302,6 +304,7 @@  static const struct ad7173_device_info ad7173_device_info[] = {
 		.num_sinc5_data_rates = ARRAY_SIZE(ad7175_sinc5_data_rates),
 	},
 	[ID_AD7177_2] = {
+		.name = "ad7177-2",
 		.id = AD7177_ID,
 		.num_inputs = 5,
 		.num_channels = 4,