Skip to content

Commit

Permalink
iio:magnetometer:bmc150_magn: output intended variable
Browse files Browse the repository at this point in the history
According to the debug/error string, the content of chip_id is supposed to
be output, rather than the return value of the previous operation.

Fixes: c91746a ("iio: magn: Add support for BMC150 magnetometer")

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Hartmut Knaack authored and Jonathan Cameron committed Jul 19, 2015
1 parent 2e187a0 commit 6a14925
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/iio/magnetometer/bmc150_magn.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,11 +706,11 @@ static int bmc150_magn_init(struct bmc150_magn_data *data)
goto err_poweroff;
}
if (chip_id != BMC150_MAGN_CHIP_ID_VAL) {
dev_err(&data->client->dev, "Invalid chip id 0x%x\n", ret);
dev_err(&data->client->dev, "Invalid chip id 0x%x\n", chip_id);
ret = -ENODEV;
goto err_poweroff;
}
dev_dbg(&data->client->dev, "Chip id %x\n", ret);
dev_dbg(&data->client->dev, "Chip id %x\n", chip_id);

preset = bmc150_magn_presets_table[BMC150_MAGN_DEFAULT_PRESET];
ret = bmc150_magn_set_odr(data, preset.odr);
Expand Down

0 comments on commit 6a14925

Please sign in to comment.