baylibre-acme: Add a missing return value check.

Check the return value of sr_gpio_setval_export() in bl_acme_set_power_off()
and return an appropriate error if the call fails.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This commit is contained in:
Bartosz Golaszewski 2015-04-13 11:44:14 +02:00 committed by Uwe Hermann
parent 09d217a40a
commit 192d37e728
1 changed files with 5 additions and 0 deletions

View File

@ -424,6 +424,11 @@ SR_PRIV int bl_acme_set_power_off(const struct sr_channel_group *cg,
}
val = sr_gpio_setval_export(pws_gpios[cgp->index], off ? 0 : 1);
if (val < 0) {
sr_err("Error setting power-off state: gpio: %d",
pws_gpios[cgp->index]);
return SR_ERR_IO;
}
return SR_OK;
}