summaryrefslogtreecommitdiffstats
path: root/drivers/usb/typec/tcpm
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-05 08:03:23 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-05 08:03:23 +0200
commita956f91247da3fe71e4d5f7da1f6dd8bae7c3c21 (patch)
treedcbfa79369938f1349af5b39a68dee698861a815 /drivers/usb/typec/tcpm
parent4e55e22d3d9aa50ef1ba059bf3a53aa61109c179 (diff)
parent7e18e42e4b280c85b76967a9106a13ca61c16179 (diff)
downloadlinux-stable-a956f91247da3fe71e4d5f7da1f6dd8bae7c3c21.tar.gz
linux-stable-a956f91247da3fe71e4d5f7da1f6dd8bae7c3c21.tar.bz2
linux-stable-a956f91247da3fe71e4d5f7da1f6dd8bae7c3c21.zip
Merge 6.0-rc4 into usb-next
We need the USB fixes in here and this resolves the merge issue in: drivers/usb/dwc3/gadget.c Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec/tcpm')
-rw-r--r--drivers/usb/typec/tcpm/tcpm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c
index ea5a917c51b1..904c7b4ce2f0 100644
--- a/drivers/usb/typec/tcpm/tcpm.c
+++ b/drivers/usb/typec/tcpm/tcpm.c
@@ -6320,6 +6320,13 @@ static int tcpm_psy_set_prop(struct power_supply *psy,
struct tcpm_port *port = power_supply_get_drvdata(psy);
int ret;
+ /*
+ * All the properties below are related to USB PD. The check needs to be
+ * property specific when a non-pd related property is added.
+ */
+ if (!port->pd_supported)
+ return -EOPNOTSUPP;
+
switch (psp) {
case POWER_SUPPLY_PROP_ONLINE:
ret = tcpm_psy_set_online(port, val);