[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210607131442.20121-7-heikki.krogerus@linux.intel.com>
Date:   Mon,  7 Jun 2021 16:14:41 +0300
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     Benjamin Berg <bberg@...hat.com>
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [RFC PATCH 6/7] usb: typec: ucsi: Filter out spurious events
Ignoring events without changes.
Signed-off-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
index a4123f77d1f16..ce80a433ef9db 100644
--- a/drivers/usb/typec/ucsi/ucsi.c
+++ b/drivers/usb/typec/ucsi/ucsi.c
@@ -839,6 +839,11 @@ static void ucsi_handle_connector_change(struct work_struct *work)
 		goto out_ack;
 	}
 
+	if (!status.change) {
+		dev_dbg(con->ucsi->dev, "con%d: spurious event\n", con->num);
+		goto out_ack;
+	}
+
 	event = kzalloc(sizeof(*event), GFP_KERNEL);
 	if (!event)
 		goto out_ack;
-- 
2.30.2
Powered by blists - more mailing lists
 
