aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys
diff options
context:
space:
mode:
authorDavid Kershner <david.kershner@unisys.com>2017-09-27 13:14:20 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-28 11:17:13 +0200
commit61f38f9a4240c4543ee9c6dd80fe4f96adc26d07 (patch)
treedf6cab21d386871b22f4fdd4c78bed1de426fa85 /drivers/staging/unisys
parentstaging: unisys: visorbus: clean up initializations (diff)
downloadlinux-dev-61f38f9a4240c4543ee9c6dd80fe4f96adc26d07.tar.xz
linux-dev-61f38f9a4240c4543ee9c6dd80fe4f96adc26d07.zip
staging: unisys: visorbus: keep the success path on the left
The code was indenting for the successful path and then combining the error and success path for the rest of the function. Correct it so the success path is not indented. Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys')
-rw-r--r--drivers/staging/unisys/visorbus/visorbus_main.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index ea124991cbdd..308372e55ffd 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -888,7 +888,7 @@ static void publish_vbus_dev_info(struct visor_device *visordev)
*/
static int visordriver_probe_device(struct device *xdev)
{
- int res;
+ int err;
struct visor_driver *drv;
struct visor_device *dev;
@@ -898,15 +898,17 @@ static int visordriver_probe_device(struct device *xdev)
mutex_lock(&dev->visordriver_callback_lock);
dev->being_removed = false;
- res = drv->probe(dev);
- if (res >= 0) {
- /* success: reference kept via unmatched get_device() */
- get_device(&dev->device);
- publish_vbus_dev_info(dev);
+ err = drv->probe(dev);
+ if (err) {
+ mutex_unlock(&dev->visordriver_callback_lock);
+ return err;
}
+ /* success: reference kept via unmatched get_device() */
+ get_device(&dev->device);
+ publish_vbus_dev_info(dev);
mutex_unlock(&dev->visordriver_callback_lock);
- return res;
+ return 0;
}
/*