]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: accel: bma220: relax constraints during probe()
authorPetre Rodan <petre.rodan@subdimension.ro>
Sun, 5 Oct 2025 13:12:11 +0000 (16:12 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Oct 2025 10:59:18 +0000 (11:59 +0100)
Do not return error if the chip id being read is not the expected one.

Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/bma220_spi.c

index 505ad70912571ba629f91e56a92898d8320e976f..02ee6b4d51c0816a88ac258f0e5107111ec2a2bc 100644 (file)
@@ -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);