mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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 <petre.rodan@subdimension.ro> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
679bf18ec0
commit
f3f42da588
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user