Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20240617-review-v3-39-88d1338c4cca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Trevor Gamblin and committed by
Jonathan Cameron
9ba22652 734ecf98

+4 -5
+4 -5
drivers/iio/proximity/sx_common.c
··· 111 111 { 112 112 if (!data->client->irq) 113 113 return 0; 114 - return regmap_update_bits(data->regmap, data->chip_info->reg_irq_msk, 115 - irq << data->chip_info->irq_msk_offset, 116 - irq << data->chip_info->irq_msk_offset); 114 + return regmap_set_bits(data->regmap, data->chip_info->reg_irq_msk, 115 + irq << data->chip_info->irq_msk_offset); 117 116 } 118 117 119 118 static int sx_common_disable_irq(struct sx_common_data *data, unsigned int irq) 120 119 { 121 120 if (!data->client->irq) 122 121 return 0; 123 - return regmap_update_bits(data->regmap, data->chip_info->reg_irq_msk, 124 - irq << data->chip_info->irq_msk_offset, 0); 122 + return regmap_clear_bits(data->regmap, data->chip_info->reg_irq_msk, 123 + irq << data->chip_info->irq_msk_offset); 125 124 } 126 125 127 126 static int sx_common_update_chan_en(struct sx_common_data *data,