linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: fieldbus: anybus: Make remove callback return void
@ 2021-05-05 20:29 Uwe Kleine-König
  2021-05-05 20:29 ` [PATCH 2/2] staging: fieldbus: anybus: Refuse registering drivers without .probe() Uwe Kleine-König
  2021-05-06  6:48 ` [PATCH 1/2] staging: fieldbus: anybus: Make remove callback return void Fabio Aiuto
  0 siblings, 2 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2021-05-05 20:29 UTC (permalink / raw)
  To: Sven Van Asbroeck, Greg Kroah-Hartman; +Cc: linux-staging, kernel

The driver core ignores the return value of struct bus_type::remove()
because there is only little that can be done. To simplify the quest to
make this function return void, let struct vio_driver::remove() return
void, too. All users already unconditionally return 0, this commit makes
it obvious that returning an error code is a bad idea.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/staging/fieldbus/anybuss/anybuss-client.h | 2 +-
 drivers/staging/fieldbus/anybuss/hms-profinet.c   | 3 +--
 drivers/staging/fieldbus/anybuss/host.c           | 3 ++-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/fieldbus/anybuss/anybuss-client.h b/drivers/staging/fieldbus/anybuss/anybuss-client.h
index 8ee1f1baccf1..a219688006fe 100644
--- a/drivers/staging/fieldbus/anybuss/anybuss-client.h
+++ b/drivers/staging/fieldbus/anybuss/anybuss-client.h
@@ -32,7 +32,7 @@ struct anybuss_client {
 struct anybuss_client_driver {
 	struct device_driver driver;
 	int (*probe)(struct anybuss_client *adev);
-	int (*remove)(struct anybuss_client *adev);
+	void (*remove)(struct anybuss_client *adev);
 	u16 anybus_id;
 };
 
diff --git a/drivers/staging/fieldbus/anybuss/hms-profinet.c b/drivers/staging/fieldbus/anybuss/hms-profinet.c
index eca7d97b8e85..e691736a53f1 100644
--- a/drivers/staging/fieldbus/anybuss/hms-profinet.c
+++ b/drivers/staging/fieldbus/anybuss/hms-profinet.c
@@ -190,12 +190,11 @@ static int profinet_probe(struct anybuss_client *client)
 	return 0;
 }
 
-static int profinet_remove(struct anybuss_client *client)
+static void profinet_remove(struct anybuss_client *client)
 {
 	struct profi_priv *priv = anybuss_get_drvdata(client);
 
 	fieldbus_dev_unregister(&priv->fbdev);
-	return 0;
 }
 
 static struct anybuss_client_driver profinet_driver = {
diff --git a/drivers/staging/fieldbus/anybuss/host.c b/drivers/staging/fieldbus/anybuss/host.c
index c97df91124a4..de6c287efa03 100644
--- a/drivers/staging/fieldbus/anybuss/host.c
+++ b/drivers/staging/fieldbus/anybuss/host.c
@@ -1194,7 +1194,8 @@ static int anybus_bus_remove(struct device *dev)
 		to_anybuss_client_driver(dev->driver);
 
 	if (adrv->remove)
-		return adrv->remove(to_anybuss_client(dev));
+		adrv->remove(to_anybuss_client(dev));
+
 	return 0;
 }
 

base-commit: d665ea6ea86c785760ee4bad4543dab3267ad074
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-05-06 17:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05 20:29 [PATCH 1/2] staging: fieldbus: anybus: Make remove callback return void Uwe Kleine-König
2021-05-05 20:29 ` [PATCH 2/2] staging: fieldbus: anybus: Refuse registering drivers without .probe() Uwe Kleine-König
2021-05-05 21:04   ` Sven Van Asbroeck
2021-05-06  6:17     ` Uwe Kleine-König
2021-05-06 13:38       ` Sven Van Asbroeck
2021-05-06  8:49     ` Fabio Aiuto
2021-05-06 13:54       ` Sven Van Asbroeck
2021-05-06 17:14         ` Fabio Aiuto
2021-05-06  6:48 ` [PATCH 1/2] staging: fieldbus: anybus: Make remove callback return void Fabio Aiuto
2021-05-06  7:52   ` Uwe Kleine-König
2021-05-06  8:40     ` Fabio Aiuto
2021-05-06  9:44       ` Dan Carpenter
2021-05-06 13:23     ` Sven Van Asbroeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).