[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 1/6] i2c: i801: Use GPIO_LOOKUP() helper macro
From: |
Geert Uytterhoeven |
Subject: |
[PATCH v7 1/6] i2c: i801: Use GPIO_LOOKUP() helper macro |
Date: |
Mon, 11 May 2020 16:52:52 +0200 |
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 <address@hidden>
Reviewed-by: Jean Delvare <address@hidden>
---
This is now commit be1b92c133cc91b2 ("i2c: i801: Use GPIO_LOOKUP()
helper macro") in i2c/for-next.
v7:
- Add Reviewed-by,
v6:
- New.
---
drivers/i2c/busses/i2c-i801.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index a9c03f5c34825a95..4f333889489c882a 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1439,9 +1439,9 @@ static int i801_add_mux(struct i801_priv *priv)
return -ENOMEM;
lookup->dev_id = "i2c-mux-gpio";
for (i = 0; i < mux_config->n_gpios; i++) {
- lookup->table[i].chip_label = mux_config->gpio_chip;
- lookup->table[i].chip_hwnum = mux_config->gpios[i];
- lookup->table[i].con_id = "mux";
+ lookup->table[i] = (struct gpiod_lookup)
+ GPIO_LOOKUP(mux_config->gpio_chip,
+ mux_config->gpios[i], "mux", 0);
}
gpiod_add_lookup_table(lookup);
priv->lookup = lookup;
--
2.17.1
- [PATCH v7 0/6] gpio: Add GPIO Aggregator, Geert Uytterhoeven, 2020/05/11
- [PATCH v7 1/6] i2c: i801: Use GPIO_LOOKUP() helper macro,
Geert Uytterhoeven <=
- [PATCH v7 3/6] gpiolib: Add support for GPIO lookup by line name, Geert Uytterhoeven, 2020/05/11
- [PATCH v7 6/6] MAINTAINERS: Add GPIO Aggregator section, Geert Uytterhoeven, 2020/05/11
- [PATCH v7 4/6] gpio: Add GPIO Aggregator, Geert Uytterhoeven, 2020/05/11
- [PATCH v7 2/6] mfd: sm501: Use GPIO_LOOKUP_IDX() helper macro, Geert Uytterhoeven, 2020/05/11
- [PATCH v7 5/6] docs: gpio: Add GPIO Aggregator documentation, Geert Uytterhoeven, 2020/05/11
- Re: [PATCH v7 0/6] gpio: Add GPIO Aggregator, Linus Walleij, 2020/05/18
- Re: [PATCH v7 0/6] gpio: Add GPIO Aggregator, Andy Shevchenko, 2020/05/20