* [PATCH] usb: misc: onboard_hub: Don't warn twice about problems during remove
@ 2023-05-30 7:36 Uwe Kleine-König
2023-05-30 14:22 ` Matthias Kaehlcke
0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2023-05-30 7:36 UTC (permalink / raw)
To: Matthias Kaehlcke, Greg Kroah-Hartman; +Cc: linux-usb, kernel
If onboard_hub_power_off() called by onboard_hub_remove() fails it emits
an error message. Forwarding the returned error value to the driver core
results in another error message. As the return value is otherwise
ignored, just drop the return value. There is no side effect apart from
suppressing the core's warning.
Instead of returning zero unconditionally, convert to .remove_new()
which has the same semantics as .remove() that unconditionally returns
zero.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/usb/misc/onboard_usb_hub.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/misc/onboard_usb_hub.c b/drivers/usb/misc/onboard_usb_hub.c
index 12fc6eb67c3b..83f14ca1d38e 100644
--- a/drivers/usb/misc/onboard_usb_hub.c
+++ b/drivers/usb/misc/onboard_usb_hub.c
@@ -278,7 +278,7 @@ static int onboard_hub_probe(struct platform_device *pdev)
return 0;
}
-static int onboard_hub_remove(struct platform_device *pdev)
+static void onboard_hub_remove(struct platform_device *pdev)
{
struct onboard_hub *hub = dev_get_drvdata(&pdev->dev);
struct usbdev_node *node;
@@ -306,7 +306,7 @@ static int onboard_hub_remove(struct platform_device *pdev)
mutex_unlock(&hub->lock);
- return onboard_hub_power_off(hub);
+ onboard_hub_power_off(hub);
}
MODULE_DEVICE_TABLE(of, onboard_hub_match);
@@ -317,7 +317,7 @@ static const struct dev_pm_ops __maybe_unused onboard_hub_pm_ops = {
static struct platform_driver onboard_hub_driver = {
.probe = onboard_hub_probe,
- .remove = onboard_hub_remove,
+ .remove_new = onboard_hub_remove,
.driver = {
.name = "onboard-usb-hub",
base-commit: b4a4be8471846d96b0ac52a0e9e7d48005cc97e2
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] usb: misc: onboard_hub: Don't warn twice about problems during remove
2023-05-30 7:36 [PATCH] usb: misc: onboard_hub: Don't warn twice about problems during remove Uwe Kleine-König
@ 2023-05-30 14:22 ` Matthias Kaehlcke
0 siblings, 0 replies; 2+ messages in thread
From: Matthias Kaehlcke @ 2023-05-30 14:22 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Greg Kroah-Hartman, linux-usb, kernel
On Tue, May 30, 2023 at 09:36:33AM +0200, Uwe Kleine-König wrote:
> If onboard_hub_power_off() called by onboard_hub_remove() fails it emits
> an error message. Forwarding the returned error value to the driver core
> results in another error message. As the return value is otherwise
> ignored, just drop the return value. There is no side effect apart from
> suppressing the core's warning.
>
> Instead of returning zero unconditionally, convert to .remove_new()
> which has the same semantics as .remove() that unconditionally returns
> zero.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Matthias Kaehlcke <mka@chromium.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-30 14:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-30 7:36 [PATCH] usb: misc: onboard_hub: Don't warn twice about problems during remove Uwe Kleine-König
2023-05-30 14:22 ` Matthias Kaehlcke
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.