staging: fieldbus: anybus: Make remove callback return void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 5 May 2021 20:29:22 +0000 (22:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 May 2021 09:19:41 +0000 (11:19 +0200)
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
anybuss_client_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>
Link: https://lore.kernel.org/r/20210505202923.198607-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fieldbus/anybuss/anybuss-client.h
drivers/staging/fieldbus/anybuss/hms-profinet.c
drivers/staging/fieldbus/anybuss/host.c

index 8ee1f1baccf12031f717c65c8ed27eba4dd66b6e..a219688006fe15174ded14c392ac9b9a2196fbcb 100644 (file)
@@ -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;
 };
 
index eca7d97b8e85a2d95b8d6e7b48e10ded358c2ad7..e691736a53f178349db87b64dcca476a55f97a3f 100644 (file)
@@ -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 = {
index c97df91124a443abe9752fa69943b04b8f57bf77..de6c287efa030f4642308b768720bf957c773258 100644 (file)
@@ -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;
 }