Commit 9ba22652 authored by Trevor Gamblin's avatar Trevor Gamblin Committed by Jonathan Cameron

iio: proximity: sx_common: make use of regmap_clear_bits(), regmap_set_bits()

Instead of using regmap_update_bits() and passing the mask twice, use
regmap_set_bits().

Instead of using regmap_update_bits() and passing val = 0, use
regmap_clear_bits().
Suggested-by: default avatarUwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: default avatarTrevor Gamblin <tgamblin@baylibre.com>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20240617-review-v3-39-88d1338c4cca@baylibre.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 734ecf98
......@@ -111,8 +111,7 @@ static int sx_common_enable_irq(struct sx_common_data *data, unsigned int irq)
{
if (!data->client->irq)
return 0;
return regmap_update_bits(data->regmap, data->chip_info->reg_irq_msk,
irq << data->chip_info->irq_msk_offset,
return regmap_set_bits(data->regmap, data->chip_info->reg_irq_msk,
irq << data->chip_info->irq_msk_offset);
}
......@@ -120,8 +119,8 @@ static int sx_common_disable_irq(struct sx_common_data *data, unsigned int irq)
{
if (!data->client->irq)
return 0;
return regmap_update_bits(data->regmap, data->chip_info->reg_irq_msk,
irq << data->chip_info->irq_msk_offset, 0);
return regmap_clear_bits(data->regmap, data->chip_info->reg_irq_msk,
irq << data->chip_info->irq_msk_offset);
}
static int sx_common_update_chan_en(struct sx_common_data *data,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment