Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i2c: consider devices with of_match_table during i2c device probing
Unlike acpi_match_device(), acpi_driver_match_device() does consider devices that provide of_match_table and performs of_compatible() matching for such devices. The key point here is that ACPI of_compatible() matching - acpi_of_match_device() - is part of ACPI and does not depend on CONFIG_OF. Consider the following case: o !CONFIG_OF system o probing of i2c device that provides .of_match_table, but no .id_table i2c_device_probe() ... if (!driver->id_table && !i2c_acpi_match_device(dev->driver->acpi_match_table, client) && !i2c_of_match_device(dev->driver->of_match_table, client)) { status = -ENODEV; goto put_sync_adapter; } i2c_of_match_device() depends on CONFIG_OF and, thus, is always false. i2c_acpi_match_device() does ACPI match only, no of_comtatible() matching takes place, even though the device provides .of_match_table and ACPI, technically, is capable of matching such device. The result is -ENODEV. Probing will succeed, however, if we'd use .of_match_table aware ACPI matching. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
- Loading branch information