greybus: interface: deactivate interface on enumeration failure
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 29 Mar 2016 22:56:05 +0000 (18:56 -0400)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 30 Mar 2016 21:23:19 +0000 (14:23 -0700)
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>
drivers/staging/greybus/svc.c

index 5c517d7e65f0758866fea05792750a34edfbd352..96d3d55f54ed3c47ea8586d1debc9176e23e9d14 100644 (file)
@@ -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);
 }