i2c: gpio: fix handling of return code of of_get_gpio
Instead of using gpio_is_valid just check the return code of of_get_gpio
for being < 0. This fixes -EPROBE_DEFER handling as now this error code
is handed to the caller instead of -ENODEV. If the gpio returned by
of_get_gpio is an invalid number this isn't noticed by
of_i2c_gpio_probe, but then gpio_request later fails which is good
enough.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 8eb1fb3 commit 8303208e95112943cccfe6252e806cc159e5106a
@Uwe Kleine-König Uwe Kleine-König authored on 16 Nov 2016
Sascha Hauer committed on 17 Nov 2016
Showing 1 changed file
View
drivers/i2c/busses/i2c-gpio.c