[PATCH -next] iio: pressure: bmp280: fix error message for wrong chip id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <mranostay@xxxxxxxxx>
Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
Cc: Matt Ranostay <mranostay@xxxxxxxxx>
Cc: Vlad Dogaru <vlad.dogaru@xxxxxxxxx>
Cc: Christoph Mair <christoph.mair@xxxxxxxxx>
Cc: Jonathan Cameron <jic23@xxxxxxxxxx>
Cc: Hartmut Knaack <knaack.h@xxxxxx>
Cc: Lars-Peter Clausen <lars@xxxxxxxxxx>
Cc: Peter Meerwald <pmeerw@xxxxxxxxxx>
---
 drivers/iio/pressure/bmp280.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/pressure/bmp280.c b/drivers/iio/pressure/bmp280.c
index 2f1498e..724452d 100644
--- a/drivers/iio/pressure/bmp280.c
+++ b/drivers/iio/pressure/bmp280.c
@@ -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;
 	}
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux