]> git.baikalelectronics.ru Git - kernel.git/commit
iio: imu: inv_icm42600: Fix broken icm42600 (chip id 0 value)
authorJean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Thu, 9 Jun 2022 10:23:01 +0000 (12:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jun 2022 07:03:28 +0000 (09:03 +0200)
commit8d612357ded1e26df1acea448c5b60b03a89b8c1
treed68ecc54a63ef313b5ceb1bed11c91dd13bd7200
parent590f54dad949ddefb366ca02c63d9dc633df7019
iio: imu: inv_icm42600: Fix broken icm42600 (chip id 0 value)

commit 488a54158c247b6a405ebcb288ce8035ded053e6 upstream.

The 0 value used for INV_CHIP_ICM42600 was not working since the
match in i2c/spi was checking against NULL value.

To keep this check, add a first INV_CHIP_INVALID 0 value as safe
guard.

Fixes: 6e3aab9801d3 ("iio: imu: inv_icm42600: add core of new inv_icm42600 driver")
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Link: https://lore.kernel.org/r/20220609102301.4794-1-jmaneyrol@invensense.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/imu/inv_icm42600/inv_icm42600.h
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c