diff options
author | Ivaylo Dimitrov <[email protected]> | 2022-11-25 20:21:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2022-12-08 16:44:39 +0100 |
commit | ecec4b20d29c3d6922dafe7d2555254a454272d2 (patch) | |
tree | 540cc3f2baa6be574d281e661ee5523d3ff63eb5 | |
parent | 4c92670b16727365699fe4b19ed32013bab2c107 (diff) |
usb: musb: remove extra check in musb_gadget_vbus_draw
The checks for musb->xceiv and musb->xceiv->set_power duplicate those in
usb_phy_set_power(), so there is no need of them. Moreover, not calling
usb_phy_set_power() results in usb_phy_set_charger_current() not being
called, so current USB config max current is not propagated through USB
charger framework and charger drivers may try to draw more current than
allowed or possible.
Fix that by removing those extra checks and calling usb_phy_set_power()
directly.
Tested on Motorola Droid4 and Nokia N900
Fixes: a9081a008f84 ("usb: phy: Add USB charger support")
Cc: stable <[email protected]>
Signed-off-by: Ivaylo Dimitrov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 6cb9514ef340..31c44325e828 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1630,8 +1630,6 @@ static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) { struct musb *musb = gadget_to_musb(gadget); - if (!musb->xceiv || !musb->xceiv->set_power) - return -EOPNOTSUPP; return usb_phy_set_power(musb->xceiv, mA); } |