usb: typec: Registering real device entries for the muxes
Subsystems (2)
Greg Kroah-Hartman
maintainerQuoted 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+Signed-off-by Heikki Krogerus <[email protected]>
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