diff mbox series

[RFC,6/7] usb: typec: ucsi: Filter out spurious events

Message ID 20210607131442.20121-7-heikki.krogerus@linux.intel.com
State New
Headers show
Series usb: typec: ucsi: Polling the alt modes and PDOs | expand

Commit Message

Heikki Krogerus June 7, 2021, 1:14 p.m. UTC
Ignoring events without changes.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/usb/typec/ucsi/ucsi.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

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;