summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-03-29 22:56:05 (GMT)
committerGreg Kroah-Hartman <gregkh@google.com>2016-03-30 21:23:19 (GMT)
commit984c9d38ae370993f28b36c8be9923b1de39f5e7 (patch)
treed71f2b27bcae7bd43652507000fc871a055f6f7f /drivers/staging/greybus
parent4d5f6218886e5d363cf41af5c5a51045f2722e50 (diff)
downloadlinux-984c9d38ae370993f28b36c8be9923b1de39f5e7.tar.xz
greybus: interface: deactivate interface on enumeration failure
Deactivate an interface immediately on enumeration failure. Note that an interface is always registered. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r--drivers/staging/greybus/svc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c
index 5c517d7..96d3d55 100644
--- a/drivers/staging/greybus/svc.c
+++ b/drivers/staging/greybus/svc.c
@@ -484,17 +484,23 @@ static void gb_svc_process_intf_hotplug(struct gb_operation *operation)
if (ret) {
dev_err(&svc->dev, "failed to activate interface %u: %d\n",
intf_id, ret);
- goto out_interface_add;
+ goto err_interface_add;
}
ret = gb_interface_enable(intf);
if (ret) {
dev_err(&svc->dev, "failed to enable interface %u: %d\n",
intf_id, ret);
- goto out_interface_add;
+ goto err_interface_deactivate;
}
-out_interface_add:
+ gb_interface_add(intf);
+
+ return;
+
+err_interface_deactivate:
+ gb_interface_deactivate(intf);
+err_interface_add:
gb_interface_add(intf);
}