]> git.baikalelectronics.ru Git - kernel.git/commit
usb: musb: remove extra check in musb_gadget_vbus_draw
authorIvaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Fri, 25 Nov 2022 18:21:15 +0000 (20:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:40:49 +0000 (11:40 +0100)
commit76df347d75a4bfa22aa93b5b633b60f5a90d2e85
treee6b2a91263de52a2ef4914409d3efa000c31869c
parent1ababbc21d81cac6c9d26279100f1acc24af1a4c
usb: musb: remove extra check in musb_gadget_vbus_draw

[ Upstream commit 621e18b1c3a909fc1cb3f1756ea83c79228489b8 ]

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: 71c7b8197d52 ("usb: phy: Add USB charger support")
Cc: stable <stable@kernel.org>
Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Link: https://lore.kernel.org/r/1669400475-4762-1-git-send-email-ivo.g.dimitrov.75@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/musb/musb_gadget.c