i2c: i801: Use GPIO_LOOKUP() helper macro
i801_add_mux() fills in the GPIO lookup table by manually populating an array of gpiod_lookup structures. Use the existing GPIO_LOOKUP() helper macro instead, to relax a dependency on the gpiod_lookup structure's member names. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
def00b32f0
commit
be1b92c133
|
@ -1439,9 +1439,9 @@ static int i801_add_mux(struct i801_priv *priv)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
lookup->dev_id = "i2c-mux-gpio";
|
lookup->dev_id = "i2c-mux-gpio";
|
||||||
for (i = 0; i < mux_config->n_gpios; i++) {
|
for (i = 0; i < mux_config->n_gpios; i++) {
|
||||||
lookup->table[i].chip_label = mux_config->gpio_chip;
|
lookup->table[i] = (struct gpiod_lookup)
|
||||||
lookup->table[i].chip_hwnum = mux_config->gpios[i];
|
GPIO_LOOKUP(mux_config->gpio_chip,
|
||||||
lookup->table[i].con_id = "mux";
|
mux_config->gpios[i], "mux", 0);
|
||||||
}
|
}
|
||||||
gpiod_add_lookup_table(lookup);
|
gpiod_add_lookup_table(lookup);
|
||||||
priv->lookup = lookup;
|
priv->lookup = lookup;
|
||||||
|
|
Loading…
Reference in New Issue