mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
iio: chemical: ens160: use regmap_assign_bits() for conditional set/clear
Replace if/else block using regmap_set_bits()/regmap_clear_bits() with the simpler regmap_assign_bits() call. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
parent
c051d08d98
commit
eb48e411a3
|
|
@ -283,12 +283,7 @@ static int ens160_set_trigger_state(struct iio_trigger *trig, bool state)
|
|||
ENS160_REG_CONFIG_INTDAT |
|
||||
ENS160_REG_CONFIG_INT_CFG;
|
||||
|
||||
if (state)
|
||||
return regmap_set_bits(data->regmap, ENS160_REG_CONFIG,
|
||||
int_bits);
|
||||
else
|
||||
return regmap_clear_bits(data->regmap, ENS160_REG_CONFIG,
|
||||
int_bits);
|
||||
return regmap_assign_bits(data->regmap, ENS160_REG_CONFIG, int_bits, state);
|
||||
}
|
||||
|
||||
static const struct iio_trigger_ops ens160_trigger_ops = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user