Skip to contentSkip to conversation

usb: typec: Registering real device entries for the muxes

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Apr 1, 2019

Subsystems (2)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw
Quoted 19 lines · Heikki Krogerus

Registering real device entries (struct device) for the mode muxes as well as for the orientation switches.

The Type-C mux code was deliberately attempting to avoid creation of separate device entries for the orientation switch and the mode switch (alternate modes) because they are not physical devices. They are functions of a single physical multiplexer/demultiplexer switch device.

Unfortunately because of the dependency we still have on the underlying mux device driver, we had to put in hacks like the one in the commit 3e3b81965cbf ("usb: typec: mux: Take care of driver module reference counting") to make sure the driver does not disappear from underneath us. Even with those hacks we were still left with a potential NUll pointer dereference scenario, so just creating the device entries, and letting the core take care of the dependencies. No more hacks needed.

Quoted 3 lines
Fixes 3e3b81965cbf ("usb: typec: mux: Take care of driver module reference counting")
Cc v4.19.x <[email protected]> # v4.19.x+

This looks good to me, nice work!

But, it would be nice if someone who has this hardware can test it to verify it does actually work :)

thanks,

greg k-h