/* In case of an error wait 1s before rebooting the modem if the modem don't request reboot (-EAGAIN). Monitor the modem every 1s.  */
static int uea_kthread(void *data)
/* In case of an error wait 1s before rebooting the modem if the modem don't request reboot (-EAGAIN). Monitor the modem every 1s.  */
static int uea_kthread(void *data)
{
	struct uea_softc *sc = data;
	int ret = -EAGAIN;
	set_freezable();
	uea_enters(INS_TO_USBDEV(sc));
	while (!kthread_should_stop()) {
		if (ret < 0 || sc->reset)
			ret = uea_start_reset(sc);
		if (!ret)
			ret = sc->stat(sc);
		if (ret != -EAGAIN)
			uea_wait(sc, 0, msecs_to_jiffies(1000));
		try_to_freeze();
	}
	uea_leaves(INS_TO_USBDEV(sc));
	return ret;
}