OSDN Git Service

usb: typec: tcpm: Refactor tcpm_handle_vdm_request payload handling
authorHans de Goede <hdegoede@redhat.com>
Fri, 24 Jul 2020 17:46:59 +0000 (19:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 12:11:05 +0000 (14:11 +0200)
commit8afe9a3548f9d1805dcea6d97978f2179c8403a3
tree9a899de804a25f821f051c29c7c1760d15fddb07
parent03eafcfb60c0da4f08a638f0dd5926fc2fc1d64a
usb: typec: tcpm: Refactor tcpm_handle_vdm_request payload handling

Refactor the tcpm_handle_vdm_request payload handling by doing the
endianness conversion only once directly inside tcpm_handle_vdm_request
itself instead of doing it multiple times inside various helper functions
called by tcpm_handle_vdm_request.

This is a preparation patch for some further refactoring to fix an AB BA
lock inversion between the tcpm code and some altmode drivers.

Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20200724174702.61754-3-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c