From 4892ba03fb21fb0fcf47d4b7bd36602a48d2f43d Mon Sep 17 00:00:00 2001 From: Tushar Behera Date: Wed, 21 Dec 2011 09:57:15 +0530 Subject: i2c-s3c2410: Don't return error if no gpio entry in Device Tree blob There can be some i2c devices which don't need to configure any gpio lines. s3c24xx_i2c_parse_dt_gpio doesn't handle the case where there is no gpio entry in the device tree blob. Added specific check to handle -ENOENT case. Signed-off-by: Tushar Behera --- drivers/i2c/busses/i2c-s3c2410.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 236f8581403..d98ce047241 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c @@ -789,6 +789,10 @@ static int s3c24xx_i2c_parse_dt_gpio(struct s3c24xx_i2c *i2c) for (idx = 0; idx < 2; idx++) { gpio = of_get_gpio(i2c->dev->of_node, idx); + + if (gpio == -ENOENT) + break; + if (!gpio_is_valid(gpio)) { dev_err(i2c->dev, "invalid gpio[%d]: %d\n", idx, gpio); goto free_gpio; -- cgit v1.2.3