Re: [PATCH] iio: adc: max1363: Use i2c_get_match_data()

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

 



On Sat, Aug 12, 2023 at 08:24:19AM +0100, Biju Das wrote:
> Replace device_get_match_data() and i2c_match_id() by
> i2c_get_match_data() by making similar I2C and DT-based matching
> table.

...

> +#define MAX1363_ID_TABLE(_name, cfg) {				\
> +	.name = _name,						\
> +	.driver_data = (kernel_ulong_t)&max1363_chip_info_tbl[cfg],	\
> +}

Just use them directly, like in 4 lines each instead of a single one.

	{
		.name = max1361,
		.driver_data = (kernel_ulong_t)&max1363_chip_info_tbl[max1361]
	},

or this, but it's almost 100 characters.

	{ .name = "max1361", .driver_data = (kernel_ulong_t)&max1363_chip_info_tbl[max1361] },


Otherwise I prefer to see something like a generic macro in i2c.h

	I2C_DEVICE_DATA()

(in analogue with PCI_DEVICE_DATA).

-- 
With Best Regards,
Andy Shevchenko





[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