OSDN Git Service

usb: typec: tcpm: Add tcpm_queue_vdm_unlocked() helper
authorHans de Goede <hdegoede@redhat.com>
Fri, 24 Jul 2020 17:46:58 +0000 (19:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jul 2020 12:11:05 +0000 (14:11 +0200)
commit03eafcfb60c0da4f08a638f0dd5926fc2fc1d64a
treea21cdd10b05959afb57d1bc60610ded798710611
parent5f2b8d87bca528616e04344d1fc4032dc5ec0f3d
usb: typec: tcpm: Add tcpm_queue_vdm_unlocked() helper

Various callers (all the typec_altmode_ops) take the port-lock just for
the tcpm_queue_vdm() call.

Add a new tcpm_queue_vdm_unlocked() helper which takes the lock, so that
its callers don't have to do this themselves.

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

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