diff mbox series

usb: dwc2: platform: Improve error reporting for problems during .remove()

Message ID 20221017195914.1426297-1-u.kleine-koenig@pengutronix.de
State New
Headers show
Series usb: dwc2: platform: Improve error reporting for problems during .remove() | expand

Commit Message

Uwe Kleine-König Oct. 17, 2022, 7:59 p.m. UTC
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>
---
 drivers/usb/dwc2/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780

Comments

Minas Harutyunyan Oct. 21, 2022, 10:41 a.m. UTC | #1
On 10/17/2022 11:59 PM, Uwe Kleine-König wrote:
> 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>

> ---
>   drivers/usb/dwc2/platform.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index ec4ace0107f5..262c13b6362a 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -321,7 +321,7 @@ static int dwc2_driver_remove(struct platform_device *dev)
>   	reset_control_assert(hsotg->reset);
>   	reset_control_assert(hsotg->reset_ecc);
>   
> -	return ret;
> +	return 0;
>   }
>   
>   /**
> 
> base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780
diff mbox series

Patch

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index ec4ace0107f5..262c13b6362a 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -321,7 +321,7 @@  static int dwc2_driver_remove(struct platform_device *dev)
 	reset_control_assert(hsotg->reset);
 	reset_control_assert(hsotg->reset_ecc);
 
-	return ret;
+	return 0;
 }
 
 /**