]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: usb251xb: fix regulator probe and error handling
authorMarco Felsch <m.felsch@pengutronix.de>
Wed, 26 Feb 2020 07:26:44 +0000 (08:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 06:18:30 +0000 (07:18 +0100)
commitbdaf3cd393603a4ac5473da140a8b0a97a09e73a
treeec7e08715b65d2dbceccae5c130ee049a861c7e6
parentda478d9d2e63f14d35a232915195634c664f19f4
usb: usb251xb: fix regulator probe and error handling

commit f06947f275f1838586792c17b6ab70da82ed7b43 upstream.

Commit 4d7201cda226 ("usb: usb251xb: add vdd supply support") didn't
covered the non-DT use-case and so the regualtor_enable() call during
probe will fail on those platforms. Also the commit didn't handled the
error case correctly.

Move devm_regulator_get() out of usb251xb_get_ofdata() to address the
1st issue. This can be done without worries because devm_regulator_get()
handles the non-DT use-case too. Add devm_add_action_or_reset() to
address the 2nd bug.

Fixes: 4d7201cda226 ("usb: usb251xb: add vdd supply support")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Cc: stable <stable@vger.kernel.org>
Acked-by: Richard Leitner <richard.leitner@skidata.com>
Link: https://lore.kernel.org/r/20200226072644.18490-1-m.felsch@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/usb251xb.c