mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-05 13:25:20 +02:00
gpio: virtuser: Use GPIO_LOOKUP_IDX() macro
Use GPIO_LOOKUP_IDX() macro which provides a compound literal and can be used with dynamic data. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240820200858.3659995-1-andriy.shevchenko@linux.intel.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
4b91188dce
commit
2a4727e6a8
|
@ -1410,7 +1410,6 @@ gpio_virtuser_make_lookup_table(struct gpio_virtuser_device *dev)
|
||||||
size_t num_entries = gpio_virtuser_get_lookup_count(dev);
|
size_t num_entries = gpio_virtuser_get_lookup_count(dev);
|
||||||
struct gpio_virtuser_lookup_entry *entry;
|
struct gpio_virtuser_lookup_entry *entry;
|
||||||
struct gpio_virtuser_lookup *lookup;
|
struct gpio_virtuser_lookup *lookup;
|
||||||
struct gpiod_lookup *curr;
|
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
|
|
||||||
lockdep_assert_held(&dev->lock);
|
lockdep_assert_held(&dev->lock);
|
||||||
|
@ -1426,14 +1425,10 @@ gpio_virtuser_make_lookup_table(struct gpio_virtuser_device *dev)
|
||||||
|
|
||||||
list_for_each_entry(lookup, &dev->lookup_list, siblings) {
|
list_for_each_entry(lookup, &dev->lookup_list, siblings) {
|
||||||
list_for_each_entry(entry, &lookup->entry_list, siblings) {
|
list_for_each_entry(entry, &lookup->entry_list, siblings) {
|
||||||
curr = &table->table[i];
|
table->table[i] =
|
||||||
|
GPIO_LOOKUP_IDX(entry->key,
|
||||||
curr->con_id = lookup->con_id;
|
entry->offset < 0 ? U16_MAX : entry->offset,
|
||||||
curr->idx = i;
|
lookup->con_id, i, entry->flags);
|
||||||
curr->key = entry->key;
|
|
||||||
curr->chip_hwnum = entry->offset < 0 ?
|
|
||||||
U16_MAX : entry->offset;
|
|
||||||
curr->flags = entry->flags;
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user