mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-08 16:04:49 +00:00
iio: addac: ad74413r: for_each_set_bit_from -> for_each_set_bit
The starting bit is always zero, it doesn't make much sense to use for_each_set_bit_from. Replace it with for_each_set_bit which doesn't start from a particular bit. Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220111074703.3677392-3-cosmin.tanislav@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
9e63be2acb
commit
ccb64316cf
@ -284,10 +284,10 @@ static void ad74413r_gpio_set_multiple(struct gpio_chip *chip,
|
|||||||
struct ad74413r_state *st = gpiochip_get_data(chip);
|
struct ad74413r_state *st = gpiochip_get_data(chip);
|
||||||
unsigned long real_mask = 0;
|
unsigned long real_mask = 0;
|
||||||
unsigned long real_bits = 0;
|
unsigned long real_bits = 0;
|
||||||
unsigned int offset = 0;
|
unsigned int offset;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
for_each_set_bit_from(offset, mask, chip->ngpio) {
|
for_each_set_bit(offset, mask, chip->ngpio) {
|
||||||
unsigned int real_offset = st->gpo_gpio_offsets[offset];
|
unsigned int real_offset = st->gpo_gpio_offsets[offset];
|
||||||
|
|
||||||
ret = ad74413r_set_gpo_config(st, real_offset,
|
ret = ad74413r_set_gpo_config(st, real_offset,
|
||||||
@ -325,7 +325,7 @@ static int ad74413r_gpio_get_multiple(struct gpio_chip *chip,
|
|||||||
unsigned long *bits)
|
unsigned long *bits)
|
||||||
{
|
{
|
||||||
struct ad74413r_state *st = gpiochip_get_data(chip);
|
struct ad74413r_state *st = gpiochip_get_data(chip);
|
||||||
unsigned int offset = 0;
|
unsigned int offset;
|
||||||
unsigned int val;
|
unsigned int val;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ static int ad74413r_gpio_get_multiple(struct gpio_chip *chip,
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
for_each_set_bit_from(offset, mask, chip->ngpio) {
|
for_each_set_bit(offset, mask, chip->ngpio) {
|
||||||
unsigned int real_offset = st->comp_gpio_offsets[offset];
|
unsigned int real_offset = st->comp_gpio_offsets[offset];
|
||||||
|
|
||||||
__assign_bit(offset, bits, val & BIT(real_offset));
|
__assign_bit(offset, bits, val & BIT(real_offset));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user