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:
parent
09d217a40a
commit
192d37e728
|
@ -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);
|
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;
|
return SR_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue