Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: light: cm3323: Add of_device_id table

Add an of_device_id table to explicitly support the Capella cm3323
Ambient Light Sensor rather than relying on matching against the
i2c_device_id table.

Signed-off-by: Siddharth Manthan <siddharth.manthan@gmail.com>
Link: https://lore.kernel.org/r/20210728110048.14593-2-siddharth.manthan@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Siddharth Manthan and committed by
Jonathan Cameron
ee8ea747 a5dfc572

+7
+7
drivers/iio/light/cm3323.c
··· 256 256 }; 257 257 MODULE_DEVICE_TABLE(i2c, cm3323_id); 258 258 259 + static const struct of_device_id cm3323_of_match[] = { 260 + { .compatible = "capella,cm3323", }, 261 + { /* sentinel */ } 262 + }; 263 + MODULE_DEVICE_TABLE(of, cm3323_of_match); 264 + 259 265 static struct i2c_driver cm3323_driver = { 260 266 .driver = { 261 267 .name = CM3323_DRV_NAME, 268 + .of_match_table = cm3323_of_match, 262 269 }, 263 270 .probe = cm3323_probe, 264 271 .id_table = cm3323_id,