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

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

 



Hi Andy Shevchenko,

Thanks for the feedback.

> Subject: Re: [PATCH] iio: adc: max1363: Use i2c_get_match_data()
> 
> 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.

OK, will create a separate patch for this change.

Worst case, we can drop named fields?? (.name and .driver_data)

Cheers,
Biju

> 
> 	{ .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 Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux