All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: typec: Send uevent for num_altmodes update
@ 2021-01-07  3:49 Prashant Malani
  2021-01-07  9:17 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Prashant Malani @ 2021-01-07  3:49 UTC (permalink / raw)
  To: linux-usb, gregkh
  Cc: Prashant Malani, Heikki Krogerus, Benson Leung, open list

Generate a change uevent when the "number_of_alternate_modes" sysfs file
for partners and plugs is updated by a port driver.

Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Cc: Benson Leung <bleung@chromium.org>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
---
 drivers/usb/typec/class.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c
index ebfd3113a9a8..8f77669f9cf4 100644
--- a/drivers/usb/typec/class.c
+++ b/drivers/usb/typec/class.c
@@ -766,6 +766,7 @@ int typec_partner_set_num_altmodes(struct typec_partner *partner, int num_altmod
 		return ret;
 
 	sysfs_notify(&partner->dev.kobj, NULL, "number_of_alternate_modes");
+	kobject_uevent(&partner->dev.kobj, KOBJ_CHANGE);
 
 	return 0;
 }
@@ -923,6 +924,7 @@ int typec_plug_set_num_altmodes(struct typec_plug *plug, int num_altmodes)
 		return ret;
 
 	sysfs_notify(&plug->dev.kobj, NULL, "number_of_alternate_modes");
+	kobject_uevent(&plug->dev.kobj, KOBJ_CHANGE);
 
 	return 0;
 }
-- 
2.29.2.729.g45daf8777d-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-09 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-07  3:49 [PATCH] usb: typec: Send uevent for num_altmodes update Prashant Malani
2021-01-07  9:17 ` Greg KH
2021-01-07  9:50   ` Prashant Malani
2021-01-07 10:57     ` Greg KH
2021-01-07 13:21       ` Greg KH
2021-01-09 22:28         ` [RFC] removing explicit #define DEBUG Tom Rix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.