summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kershner <david.kershner@unisys.com>2017-03-28 09:34:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-29 09:17:03 +0200
commit293deb2c0ca4f541b1bed06c1f5dd25cdb60a2d8 (patch)
tree600ae4b9dc38ab865902c8fab6017bf8c6bf778c
parent711c67f4ecc81a8b1ebf26844c5874888078ed46 (diff)
staging: unisys: visorbus: don't unregister if we failed to register
If we fail to register the visordriver, don't call unregister, just return with the error. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/unisys/visorbus/visorbus_main.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index af9bf2453b44..0aa731d09c1f 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -959,8 +959,6 @@ visordriver_probe_device(struct device *xdev)
*/
int visorbus_register_visor_driver(struct visor_driver *drv)
{
- int rc = 0;
-
drv->driver.name = drv->name;
drv->driver.bus = &visorbus_type;
drv->driver.probe = visordriver_probe_device;
@@ -980,10 +978,7 @@ int visorbus_register_visor_driver(struct visor_driver *drv)
* dev.drv = NULL
*/
- rc = driver_register(&drv->driver);
- if (rc < 0)
- driver_unregister(&drv->driver);
- return rc;
+ return driver_register(&drv->driver);
}
EXPORT_SYMBOL_GPL(visorbus_register_visor_driver);