Hi Geert, Thanks for the feedback. > -----Original Message----- > From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> > Sent: Monday, July 17, 2023 10:17 AM > To: Biju Das <biju.das.jz@xxxxxxxxxxxxxx> > Cc: Peter Rosin <peda@xxxxxxxxxx>; Michael Hennerich > <michael.hennerich@xxxxxxxxxx>; linux-i2c@xxxxxxxxxxxxxxx; Prabhakar > Mahadev Lad <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>; linux-renesas- > soc@xxxxxxxxxxxxxxx > Subject: Re: [PATCH] i2c: mux: ltc4306: Simplify probe() > > Hi Biju, > > On Sun, Jul 16, 2023 at 8:51 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> > wrote: > > The ltc4306_id[].driver_data could store a pointer to the chips, like > > for DT-based matching, making I2C and DT-based matching more similar. > > > > After that, we can simplify the probe() by replacing of_device_get_ > > match_data() and i2c_match_id() by i2c_get_match_data() as we have > > similar I2C and DT-based matching table. > > > > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx> > > Thanks for your patch! > > Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > > A suggestion for improvement (which can be a separate patch, as it would > touch ltc4306_of_match[] too) below. OK. > > > --- a/drivers/i2c/muxes/i2c-mux-ltc4306.c > > +++ b/drivers/i2c/muxes/i2c-mux-ltc4306.c > > @@ -192,8 +192,8 @@ static int ltc4306_deselect_mux(struct > > i2c_mux_core *muxc, u32 chan) } > > > > static const struct i2c_device_id ltc4306_id[] = { > > - { "ltc4305", ltc_4305 }, > > - { "ltc4306", ltc_4306 }, > > + { "ltc4305", .driver_data = (kernel_ulong_t)&chips[ltc_4305] > }, > > + { "ltc4306", .driver_data = (kernel_ulong_t)&chips[ltc_4306] > > + }, > > As after this the ltc_type enum values are used only for hardcoded > indexing inside the chips array, you can get rid of them by splitting > the array in individual variables, shortening the lines above (and in > ltc4306_of_match[] below) in the process. Agreed. Will send separate patch for this. Cheers, Biju