iio: st_sensors: relax WhoAmI check in st_sensors_verify_id()
authorKaustabh Chakraborty <kauschluss@disroot.org>
Tue, 25 Jun 2024 08:27:55 +0000 (13:57 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 29 Jun 2024 18:44:43 +0000 (19:44 +0100)
Hard matching against the WhoAmI values isn't ideal for using devices
which are compatible with existing ones. Instead of raising an error,
issue a warning instead, thus allowing the driver to continue probing.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Link: https://patch.msgid.link/20240625082800.62305-1-kauschluss@disroot.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/common/st_sensors/st_sensors_core.c

index c77d7bd..c69399a 100644 (file)
@@ -606,10 +606,9 @@ int st_sensors_verify_id(struct iio_dev *indio_dev)
                }
 
                if (sdata->sensor_settings->wai != wai) {
-                       dev_err(&indio_dev->dev,
+                       dev_warn(&indio_dev->dev,
                                "%s: WhoAmI mismatch (0x%x).\n",
                                indio_dev->name, wai);
-                       return -EINVAL;
                }
        }