[PATCH 2/4] gpio: pca953x: depend on i2c slice

Sascha Hauer s.hauer at pengutronix.de
Wed Feb 21 06:27:58 PST 2024


The GPIOs provided by the pca953x cannot be used inside a poller while
the I2C controller is in use. Add a dependency to from the GPIO
controller to the I2C controller for this purpose.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/gpio/gpio-pca953x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index cee60f7a65..e303f6b21f 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -475,6 +475,8 @@ static int pca953x_probe(struct device *dev)
 	if (ret)
 		return ret;
 
+	slice_depends_on(gpiochip_slice(&chip->gpio_chip), i2c_client_slice(client));
+
 	if (pdata && pdata->setup) {
 		ret = pdata->setup(client, chip->gpio_chip.base,
 				chip->gpio_chip.ngpio, pdata->context);
-- 
2.39.2




More information about the barebox mailing list