Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f2593b7 authored by Jack Pham's avatar Jack Pham Committed by Gerrit - the friendly Code Review server
Browse files

usb: pd: Remove log message from pd_timeout



The pd_timeout() timer callback function is used quite often
in scheduling state machine delays and serves multiple purposes
such as waiting for a response, delaying before executing power
supply transitions, etc. As such, the log message is sometimes
misconstrued as an error condition and may confuse the reader.
Instead, move the log print to kick_sm() in case the state
machine is queued with a delay.

Change-Id: I3879aecd39f44eb7a3c5135f086096261316c64d
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 2e7c3098
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -900,11 +900,13 @@ static void kick_sm(struct usbpd *pd, int ms)
	pm_stay_awake(&pd->dev);
	pd->sm_queued = true;

	if (ms)
	if (ms) {
		usbpd_dbg(&pd->dev, "delay %d ms", ms);
		hrtimer_start(&pd->timer, ms_to_ktime(ms), HRTIMER_MODE_REL);
	else
	} else {
		queue_work(pd->wq, &pd->sm_work);
	}
}

static void phy_sig_received(struct usbpd *pd, enum pd_sig_type sig)
{
@@ -1170,7 +1172,6 @@ static enum hrtimer_restart pd_timeout(struct hrtimer *timer)
{
	struct usbpd *pd = container_of(timer, struct usbpd, timer);

	usbpd_dbg(&pd->dev, "timeout");
	queue_work(pd->wq, &pd->sm_work);

	return HRTIMER_NORESTART;