usb: typec: tcpci: use GENMASK() for TCPC_ROLE_CTRL_CC[12]
All this open-coded shifting and masking is quite hard to read, in particular the if-statement in tcpci_apply_rc(). Declare TCPC_ROLE_CTRL_CC[12] using GENMASK() which allows using FIELD_GET() and FIELD_PREP() to arguably make the code more legible. Signed-off-by:André Draszik <andre.draszik@linaro.org> Reviewed-by:
Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20240710-tcpc-cleanup-v1-4-0ec1f41f4263@linaro.org Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Loading
Please sign in to comment