Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95657f40 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "usb: typec: Fix setting of invalid value of opmode"

parents 3c79e098 c4e5ee5b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1369,7 +1369,8 @@ void typec_set_pwr_opmode(struct typec_port *port,
{
	struct device *partner_dev;

	if (port->pwr_opmode == opmode)
	if ((port->pwr_opmode == opmode) || (opmode < TYPEC_PWR_MODE_USB) ||
						(opmode > TYPEC_PWR_MODE_PD))
		return;

	port->pwr_opmode = opmode;