From f3f42da58803e606d50b01d6ae63454a4f0cfa2b Mon Sep 17 00:00:00 2001 From: Petre Rodan Date: Sun, 5 Oct 2025 16:12:11 +0300 Subject: [PATCH] iio: accel: bma220: relax constraints during probe() Do not return error if the chip id being read is not the expected one. Signed-off-by: Petre Rodan Signed-off-by: Jonathan Cameron --- drivers/iio/accel/bma220_spi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c index 505ad70912571..02ee6b4d51c08 100644 --- a/drivers/iio/accel/bma220_spi.c +++ b/drivers/iio/accel/bma220_spi.c @@ -202,10 +202,15 @@ static const struct iio_info bma220_info = { static int bma220_init(struct spi_device *spi) { int ret; + struct device *dev = &spi->dev; ret = bma220_read_reg(spi, BMA220_REG_ID); + if (ret < 0) + return dev_err_probe(dev, ret, + "Failed to read chip id register\n"); + if (ret != BMA220_CHIP_ID) - return -ENODEV; + dev_info(dev, "Unknown chip found: 0x%02x\n", ret); /* Make sure the chip is powered on */ ret = bma220_read_reg(spi, BMA220_REG_SUSPEND); -- 2.47.3