usb: dwc2: platform: Improve error reporting for problems during .remove()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 17 Oct 2022 19:59:14 +0000 (21:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:21:48 +0000 (16:21 +0200)
commit98b6582b37da030873056a4f3ac29c56183ad952
treef4e87130cc43bfbc52bb98dad33688c6c7ff94ae
parente91366b72c36ebccc64373a80c6dfcfba209a3ae
usb: dwc2: platform: Improve error reporting for problems during .remove()

[ Upstream commit 55f223b8b408cbfd85fb1c5b74ab85ccab319a69 ]

Returning an error value in a platform driver's remove callback results in
a generic error message being emitted by the driver core, but otherwise it
doesn't make a difference. The device goes away anyhow.

For each case where ret is non-zero the driver already emits an error
message, so suppress the generic error message by returning zero
unconditionally. (Side note: The return value handling was unreliable
anyhow as the value returned by dwc2_exit_hibernation() was overwritten
anyhow if hsotg->in_ppd was non-zero.)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Minas Harutyunyan <hminas@synopsys.com>
Link: https://lore.kernel.org/r/20221017195914.1426297-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: ada050c69108 ("usb: dwc2: Fix some error handling paths")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc2/platform.c