gpio: get rid of compiler warnings

This commit is contained in:
Arnaud Ferraris
2020-12-13 00:46:46 +01:00
parent dd904bc8c1
commit b495d6c747

View File

@@ -112,18 +112,23 @@ void modem_configure(struct EG25Manager *manager)
void modem_reset(struct EG25Manager *manager)
{
int fd;
int fd, ret, len = strlen(manager->modem_usb_id);
fd = open("/sys/bus/usb/drivers/usb/unbind", O_WRONLY);
if (fd < 0)
goto error;
write(fd, manager->modem_usb_id, strlen(manager->modem_usb_id));
ret = write(fd, manager->modem_usb_id, len);
if (ret < len)
g_warning("Couldn't unbind modem: wrote %d/%d bytes", ret, len);
close(fd);
fd = open("/sys/bus/usb/drivers/usb/bind", O_WRONLY);
if (fd < 0)
goto error;
write(fd, manager->modem_usb_id, strlen(manager->modem_usb_id));
ret = write(fd, manager->modem_usb_id, len);
if (ret < len)
g_warning("Couldn't unbind modem: wrote %d/%d bytes", ret, len);
close(fd);
return;