On Thu, May 18, 2023 at 1:37 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote: > The isl1208_id[].driver_data could store a pointer to the config, > like for DT-based matching, making I2C and DT-based matching > more similar. > > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx> > --- > v4: > * New patch. Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > @@ -822,9 +822,9 @@ isl1208_probe(struct i2c_client *client) > } else { > const struct i2c_device_id *id = i2c_match_id(isl1208_id, client); > > - if (id->driver_data >= ISL_LAST_ID) > + if (!id) > return -ENODEV; > - isl1208->config = &isl1208_configs[id->driver_data]; > + isl1208->config = (struct isl1208_config *)id->driver_data; It's a pity there's no i2c_get_match_data() yet... Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds