diff options
Diffstat (limited to 'drivers/staging/fieldbus')
-rw-r--r-- | drivers/staging/fieldbus/anybuss/anybuss-client.h | 2 | ||||
-rw-r--r-- | drivers/staging/fieldbus/anybuss/hms-profinet.c | 3 | ||||
-rw-r--r-- | drivers/staging/fieldbus/anybuss/host.c | 8 |
3 files changed, 7 insertions, 6 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..0f730efe9a6d 100644 --- a/drivers/staging/fieldbus/anybuss/host.c +++ b/drivers/staging/fieldbus/anybuss/host.c @@ -1183,8 +1183,6 @@ static int anybus_bus_probe(struct device *dev) struct anybuss_client *adev = to_anybuss_client(dev); - if (!adrv->probe) - return -ENODEV; return adrv->probe(adev); } @@ -1194,7 +1192,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; } @@ -1207,6 +1206,9 @@ static struct bus_type anybus_bus = { int anybuss_client_driver_register(struct anybuss_client_driver *drv) { + if (!drv->probe) + return -ENODEV; + drv->driver.bus = &anybus_bus; return driver_register(&drv->driver); } |