Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 44cf3798 authored by Hartmut Knaack's avatar Hartmut Knaack Committed by Jonathan Cameron
Browse files

iio:pressure:bmp280: cleanup



The calculations for temperature and pressure compensation were already slightly
optimized in comparison to the datasheet. So, it makes sense to optimize even a
bit more, making proper use of C operators:
  - variable t in bmp280_compensate_temp() can be eliminated by directly
    returning the result of the relevant equation.
  - make use of the += operator and eliminate an unnecessary parenthesis level in
    bmp280_compensate_press().
When the initialization of the ctrl_meas register fails, the error message will
now mention the right register name.
During probe, i2c_set_clientdata() is called, although it is not necessary. Drop
it.

Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
Reviewed-by: default avatarVlad Dogaru <vlad.dogaru@intel.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 762c4da3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment