Commit 61f38f9a authored by David Kershner's avatar David Kershner Committed by Greg Kroah-Hartman

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: default avatarDavid Kershner <david.kershner@unisys.com>
Reviewed-by: default avatarTim Sell <timothy.sell@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5d1a7fd7
...@@ -888,7 +888,7 @@ static void publish_vbus_dev_info(struct visor_device *visordev) ...@@ -888,7 +888,7 @@ static void publish_vbus_dev_info(struct visor_device *visordev)
*/ */
static int visordriver_probe_device(struct device *xdev) static int visordriver_probe_device(struct device *xdev)
{ {
int res; int err;
struct visor_driver *drv; struct visor_driver *drv;
struct visor_device *dev; struct visor_device *dev;
...@@ -898,15 +898,17 @@ static int visordriver_probe_device(struct device *xdev) ...@@ -898,15 +898,17 @@ static int visordriver_probe_device(struct device *xdev)
mutex_lock(&dev->visordriver_callback_lock); mutex_lock(&dev->visordriver_callback_lock);
dev->being_removed = false; dev->being_removed = false;
res = drv->probe(dev); err = drv->probe(dev);
if (res >= 0) { if (err) {
/* success: reference kept via unmatched get_device() */ mutex_unlock(&dev->visordriver_callback_lock);
get_device(&dev->device); return err;
publish_vbus_dev_info(dev);
} }
/* success: reference kept via unmatched get_device() */
get_device(&dev->device);
publish_vbus_dev_info(dev);
mutex_unlock(&dev->visordriver_callback_lock); mutex_unlock(&dev->visordriver_callback_lock);
return res; return 0;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment