USB: EHCI: ehci-mv: improve error handling in mv_ehci_enable()
authorEvgeny Novikov <novikov@ispras.ru>
Thu, 8 Jul 2021 08:30:56 +0000 (11:30 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:40:19 +0000 (13:40 +0200)
commit5534de13b6dc23f890fad9194bacf5da05248a61
tree958a961626e4a07252fc9d3697efff73ecbc790d
parentb2b8137ec9205900c4608f7c9e6667d8626ed472
USB: EHCI: ehci-mv: improve error handling in mv_ehci_enable()

[ Upstream commit 61136a12cbed234374ec6f588af57c580b20b772 ]

mv_ehci_enable() did not disable and unprepare clocks in case of
failures of phy_init(). Besides, it did not take into account failures
of ehci_clock_enable() (in effect, failures of clk_prepare_enable()).
The patch fixes both issues and gets rid of redundant wrappers around
clk_prepare_enable() and clk_disable_unprepare() to simplify this a bit.

Found by Linux Driver Verification project (linuxtesting.org).

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Link: https://lore.kernel.org/r/20210708083056.21543-1-novikov@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/ehci-mv.c