Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2018 14:27:14 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340971 - head/sys/arm/allwinner
Message-ID:  <201811261427.wAQERE40019887@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: manu
Date: Mon Nov 26 14:27:13 2018
New Revision: 340971
URL: https://svnweb.freebsd.org/changeset/base/340971

Log:
  aw_usbphy: Do not error if it's not phy 0
  
  Only phy0 can switch between host/otg, do not error if we request
  host mode on phy != 0.
  
  MFC after:	1 month
  X-MFC with:	r340846

Modified:
  head/sys/arm/allwinner/aw_usbphy.c

Modified: head/sys/arm/allwinner/aw_usbphy.c
==============================================================================
--- head/sys/arm/allwinner/aw_usbphy.c	Mon Nov 26 14:01:05 2018	(r340970)
+++ head/sys/arm/allwinner/aw_usbphy.c	Mon Nov 26 14:27:13 2018	(r340971)
@@ -389,8 +389,11 @@ awusbphy_set_mode(struct phynode *phynode, int mode)
 	phy = phynode_get_id(phynode);
 	sc = device_get_softc(dev);
 
-	if (phy != 0)
-		return (EINVAL);
+	if (phy != 0) {
+		if (mode != PHY_USB_MODE_HOST)
+			return (EINVAL);
+		return (0);
+	}
 
 	switch (mode) {
 	case PHY_USB_MODE_HOST:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811261427.wAQERE40019887>