From 198e1deb5fde5595699e4f0e1fa456e810125d54 Mon Sep 17 00:00:00 2001 From: Emmanuel Vadot Date: Mon, 26 Nov 2018 14:27:13 +0000 Subject: [PATCH] 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 --- sys/arm/allwinner/aw_usbphy.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/arm/allwinner/aw_usbphy.c b/sys/arm/allwinner/aw_usbphy.c index e658ad77ac2f..0b8bcf539602 100644 --- a/sys/arm/allwinner/aw_usbphy.c +++ b/sys/arm/allwinner/aw_usbphy.c @@ -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: