]> git.baikalelectronics.ru Git - kernel.git/commit
iio: mma8452: Fix probe failing when an i2c_device_id is used
authorHans de Goede <hdegoede@redhat.com>
Tue, 8 Feb 2022 12:43:35 +0000 (13:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:45 +0000 (14:23 +0200)
commitfb817f8ef6e1425811c637f3b0a71196c4f3b702
tree02b69dcb1cd0647b4f05e7626ffa0954bef5221b
parent252c49975b3ce2f863c9acda38085008ec8fd0b1
iio: mma8452: Fix probe failing when an i2c_device_id is used

[ Upstream commit a708770a4fa8e329a68aa7d765f3e971fea22524 ]

The mma8452_driver declares both of_match_table and i2c_driver.id_table
match-tables, but its probe() function only checked for of matches.

Add support for i2c_device_id matches. This fixes the driver not loading
on some x86 tablets (e.g. the Nextbook Ares 8) where the i2c_client is
instantiated by platform code using an i2c_device_id.

Drop of_match_ptr() protection to avoid unused warning.

Fixes: e67445b4a8f7 ("iio: mma8452: refactor for seperating chip specific data")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20220208124336.511884-1-hdegoede@redhat.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/accel/mma8452.c