diff options
| -rw-r--r-- | drivers/usb/typec/tcpm/tcpm.c | 7 | 
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); |