提交 5e02bac3 编写于 作者: L Linus Walleij 提交者: Jonathan Cameron

iio: st_sensors: make detection more helpful

The ST sensors are detected by reading a WhoAmI register and
matching the number found to a sensor name string. To make it
easier to figure out what happens when things go wrong, print
the WhoAmI value and the device name we're trying to match.
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 bb60646c
...@@ -503,7 +503,8 @@ int st_sensors_check_device_support(struct iio_dev *indio_dev, ...@@ -503,7 +503,8 @@ int st_sensors_check_device_support(struct iio_dev *indio_dev,
break; break;
} }
if (n == ARRAY_SIZE(sensor_settings[i].sensors_supported)) { if (n == ARRAY_SIZE(sensor_settings[i].sensors_supported)) {
dev_err(&indio_dev->dev, "device name and WhoAmI mismatch.\n"); dev_err(&indio_dev->dev, "device name \"%s\" and WhoAmI (0x%02x) mismatch",
indio_dev->name, wai);
goto sensor_name_mismatch; goto sensor_name_mismatch;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册