October 2017
Intermediate to advanced
586 pages
14h 8m
English
For kernel versions older than 4.10, if you look at drivers/i2c/i2c-core.c in the i2c_device_probe() function (for information, it is the function the kernel calls every time an I2C device is registered to the I2C core), you will see something like this:
if (!driver->probe || !driver->id_table)
return -ENODEV;
This means that even if you do not need to use the .id_table, it is mandatory in the driver. In fact, you can use the OF match style only, but cannot get rid of .id_table. Kernel developers tried to remove the need for .id_table and exclusively use .of_match_table for device matching. The patch is available at this URL: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c80f52847c50109ca248c22efbf71ff10553dca4 ...