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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ignoring events without changes.

Signed-off-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux