Skip to content

Commit

Permalink
iio: pressure: bmp280: Drop unneeded explicit castings
Browse files Browse the repository at this point in the history
In few places the unnecessary explicit castings are being used.
Drop them for good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Andy Shevchenko authored and Jonathan Cameron committed Apr 19, 2020
1 parent df6e712 commit a7a047e
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions drivers/iio/pressure/bmp280-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,7 @@ static int bmp280_read_temp(struct bmp280_data *data,
__be32 tmp = 0;
s32 adc_temp, comp_temp;

ret = regmap_bulk_read(data->regmap, BMP280_REG_TEMP_MSB,
(u8 *) &tmp, 3);
ret = regmap_bulk_read(data->regmap, BMP280_REG_TEMP_MSB, &tmp, 3);
if (ret < 0) {
dev_err(data->dev, "failed to read temperature\n");
return ret;
Expand Down Expand Up @@ -377,8 +376,7 @@ static int bmp280_read_press(struct bmp280_data *data,
if (ret < 0)
return ret;

ret = regmap_bulk_read(data->regmap, BMP280_REG_PRESS_MSB,
(u8 *) &tmp, 3);
ret = regmap_bulk_read(data->regmap, BMP280_REG_PRESS_MSB, &tmp, 3);
if (ret < 0) {
dev_err(data->dev, "failed to read pressure\n");
return ret;
Expand All @@ -400,8 +398,8 @@ static int bmp280_read_press(struct bmp280_data *data,

static int bmp280_read_humid(struct bmp280_data *data, int *val, int *val2)
{
__be16 tmp;
int ret;
__be16 tmp = 0;
s32 adc_humidity;
u32 comp_humidity;

Expand All @@ -410,8 +408,7 @@ static int bmp280_read_humid(struct bmp280_data *data, int *val, int *val2)
if (ret < 0)
return ret;

ret = regmap_bulk_read(data->regmap, BMP280_REG_HUMIDITY_MSB,
(u8 *) &tmp, 2);
ret = regmap_bulk_read(data->regmap, BMP280_REG_HUMIDITY_MSB, &tmp, 2);
if (ret < 0) {
dev_err(data->dev, "failed to read humidity\n");
return ret;
Expand Down Expand Up @@ -733,14 +730,14 @@ static int bmp180_measure(struct bmp280_data *data, u8 ctrl_meas)

static int bmp180_read_adc_temp(struct bmp280_data *data, int *val)
{
__be16 tmp;
int ret;
__be16 tmp = 0;

ret = bmp180_measure(data, BMP180_MEAS_TEMP);
if (ret)
return ret;

ret = regmap_bulk_read(data->regmap, BMP180_REG_OUT_MSB, (u8 *)&tmp, 2);
ret = regmap_bulk_read(data->regmap, BMP180_REG_OUT_MSB, &tmp, 2);
if (ret)
return ret;

Expand Down Expand Up @@ -837,7 +834,7 @@ static int bmp180_read_adc_press(struct bmp280_data *data, int *val)
if (ret)
return ret;

ret = regmap_bulk_read(data->regmap, BMP180_REG_OUT_MSB, (u8 *)&tmp, 3);
ret = regmap_bulk_read(data->regmap, BMP180_REG_OUT_MSB, &tmp, 3);
if (ret)
return ret;

Expand Down

0 comments on commit a7a047e

Please sign in to comment.