Re: [PATCH 2/4] iio: light: al3000a: Use DRV_NAME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 08 Mar 2025 21:00:59 +0100
David Heidelberg via B4 Relay <devnull+david.ixit.cz@xxxxxxxxxx> wrote:

> From: David Heidelberg <david@xxxxxxx>
> 
> Sync syntax with other similar drivers.

Sorry no. This is a syntax I am against and frequently request people to not
use in drivers.

The  main reason is there is no explicit reason the two locations you use it
in here should use the same string.  Using a define makes that implication
and I'd prefer that we did not.  Note that if they were required to be the
same then a define would make sense.

I want to look at the code and see the string directly in these locations
rather than go look for a define that adds nothing.

Jonathan




> 
> Signed-off-by: David Heidelberg <david@xxxxxxx>
> ---
>  drivers/iio/light/al3000a.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/light/al3000a.c b/drivers/iio/light/al3000a.c
> index e2fbb1270040f43d9f0a97838861818a8eaef813..e1fa4543f336cec61140b5c44d3794df1fa485cd 100644
> --- a/drivers/iio/light/al3000a.c
> +++ b/drivers/iio/light/al3000a.c
> @@ -13,6 +13,8 @@
>  
>  #include <linux/iio/iio.h>
>  
> +#define AL3000A_DRV_NAME "al3000a"
> +
>  #define AL3000A_REG_SYSTEM		0x00
>  #define AL3000A_REG_DATA		0x05
>  
> @@ -148,7 +150,7 @@ static int al3000a_probe(struct i2c_client *client)
>  				     "failed to get vdd regulator\n");
>  
>  	indio_dev->info = &al3000a_info;
> -	indio_dev->name = "al3000a";
> +	indio_dev->name = AL3000A_DRV_NAME;
>  	indio_dev->channels = al3000a_channels;
>  	indio_dev->num_channels = ARRAY_SIZE(al3000a_channels);
>  	indio_dev->modes = INDIO_DIRECT_MODE;
> @@ -195,7 +197,7 @@ MODULE_DEVICE_TABLE(of, al3000a_of_match);
>  
>  static struct i2c_driver al3000a_driver = {
>  	.driver = {
> -		.name = "al3000a",
> +		.name = AL3000A_DRV_NAME,
>  		.of_match_table = al3000a_of_match,
>  		.pm = pm_sleep_ptr(&al3000a_pm_ops),
>  	},
> 





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux