diff options
author | Tushar Behera <tushar.behera@linaro.org> | 2011-12-21 09:57:15 +0530 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2011-12-21 11:14:28 +0530 |
commit | 4892ba03fb21fb0fcf47d4b7bd36602a48d2f43d (patch) | |
tree | 55f205f55e53b31801d6d65e65f93dfaaf64f407 | |
parent | 0487a75582a8ed410955e67fe6f2d4d95baf754b (diff) |
i2c-s3c2410: Don't return error if no gpio entry in Device Tree blobsamsung-lt-v3.2-rc6-1
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 <tushar.behera@linaro.org>
-rw-r--r-- | drivers/i2c/busses/i2c-s3c2410.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |