mirror of
https://gitlab.com/mobian1/eg25-manager.git
synced 2025-08-29 15:22:20 +02:00
gpio: exit if we can't request output GPIOs
This means the system is in a very bad shape as no other software should make use of those, so exit the daemon (will be restarted by systemd).
This commit is contained in:
@@ -131,13 +131,13 @@ int gpio_init(struct EG25Manager *manager)
|
|||||||
|
|
||||||
manager->gpio_out[i] = gpiod_chip_get_line(manager->gpiochip[chipidx], offset);
|
manager->gpio_out[i] = gpiod_chip_get_line(manager->gpiochip[chipidx], offset);
|
||||||
if (!manager->gpio_out[i]) {
|
if (!manager->gpio_out[i]) {
|
||||||
g_critical("Unable to get output GPIO %d", i);
|
g_error("Unable to get output GPIO %d", i);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = gpiod_line_request_output(manager->gpio_out[i], "eg25manager", 0);
|
ret = gpiod_line_request_output(manager->gpio_out[i], "eg25manager", 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
g_critical("Unable to request output GPIO %d", i);
|
g_error("Unable to request output GPIO %d", i);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user