gpio.c: check that real gpio did initialise correctly
On platforms without muxing perform a little more checking when the 'real' linux/sysfs gpio is opened. We don't expect this to fail but on platforms where the linux gpios can be changed depending on pinctrl/bios configuration this might not always be the case. Signed-off-by: Henry Bruce <henry.bruce@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Thomas Ingleby
parent
6bc2b0fb53
commit
57540cd86c
@@ -75,6 +75,10 @@ mraa_gpio_init(int pin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mraa_gpio_context r = mraa_gpio_init_raw(plat->pins[pin].gpio.pinmap);
|
mraa_gpio_context r = mraa_gpio_init_raw(plat->pins[pin].gpio.pinmap);
|
||||||
|
if (r == NULL) {
|
||||||
|
syslog(LOG_CRIT, "gpio: mraa_setup_gpio(%d) returned error %d", pin, r);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
r->phy_pin = pin;
|
r->phy_pin = pin;
|
||||||
|
|
||||||
if (advance_func->gpio_init_post != NULL) {
|
if (advance_func->gpio_init_post != NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user