Skip to content

Commit

Permalink
iio: pressure: bmp280: fix error message for wrong chip id
Browse files Browse the repository at this point in the history
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: Matt Ranostay <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Cc: Matt Ranostay <[email protected]>
Cc: Vlad Dogaru <[email protected]>
Cc: Christoph Mair <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Hartmut Knaack <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Peter Meerwald <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
mita authored and jic23 committed May 14, 2016
1 parent 53dfc3b commit a3e5afe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/pressure/bmp280.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a3e5afe

Please sign in to comment.