size_t num_entries = gpio_virtuser_get_lookup_count(dev);
        struct gpio_virtuser_lookup_entry *entry;
        struct gpio_virtuser_lookup *lookup;
-       struct gpiod_lookup *curr;
        unsigned int i = 0;
 
        lockdep_assert_held(&dev->lock);
 
        list_for_each_entry(lookup, &dev->lookup_list, siblings) {
                list_for_each_entry(entry, &lookup->entry_list, siblings) {
-                       curr = &table->table[i];
-
-                       curr->con_id = lookup->con_id;
-                       curr->idx = i;
-                       curr->key = entry->key;
-                       curr->chip_hwnum = entry->offset < 0 ?
-                                               U16_MAX : entry->offset;
-                       curr->flags = entry->flags;
+                       table->table[i] =
+                               GPIO_LOOKUP_IDX(entry->key,
+                                               entry->offset < 0 ? U16_MAX : entry->offset,
+                                               lookup->con_id, i, entry->flags);
                        i++;
                }
        }