Commit a3e5afe4 authored by Akinobu Mita's avatar Akinobu Mita Committed by Jonathan Cameron

iio: pressure: bmp280: fix error message for wrong chip id

The bmp280 driver also supports BMP180 which has a different chip id
with BMP280.  The probe routine verifies that the device reports the
correct chip id but the error message is confusing as if BMP280's chip
id is always expected.
Reported-by: default avatarMatt Ranostay <mranostay@gmail.com>
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: Matt Ranostay <mranostay@gmail.com>
Cc: Vlad Dogaru <vlad.dogaru@intel.com>
Cc: Christoph Mair <christoph.mair@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 53dfc3b9
......@@ -879,8 +879,8 @@ static int bmp280_probe(struct i2c_client *client,
if (ret < 0)
return ret;
if (chip_id != id->driver_data) {
dev_err(&client->dev, "bad chip id. expected %x got %x\n",
BMP280_CHIP_ID, chip_id);
dev_err(&client->dev, "bad chip id. expected %lx got %x\n",
id->driver_data, chip_id);
return -EINVAL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment