gb_interface_remove(intf);
}
-/**
- * gb_interface_init
- *
- * Create connection for control CPort and then request/parse manifest.
- * Finally initialize all the bundles to set routes via SVC and initialize all
- * connections.
+/*
+ * Intialise an interface by enabling the control connection and fetching the
+ * manifest and other information over it.
*/
int gb_interface_init(struct gb_interface *intf)
{
- struct gb_bundle *bundle, *tmp;
int ret, size;
void *manifest;
if (ret)
goto free_manifest;
- /* Register the interface and its bundles. */
+free_manifest:
+ kfree(manifest);
+
+ return ret;
+}
+
+/* Register an interface and its bundles. */
+int gb_interface_add(struct gb_interface *intf)
+{
+ struct gb_bundle *bundle, *tmp;
+ int ret;
+
ret = device_add(&intf->dev);
if (ret) {
dev_err(&intf->dev, "failed to register interface: %d\n", ret);
- goto free_manifest;
+ return ret;
}
dev_info(&intf->dev, "Interface added: VID=0x%08x, PID=0x%08x\n",
}
}
- ret = 0;
-
-free_manifest:
- kfree(manifest);
- return ret;
+ return 0;
}
struct gb_interface *gb_interface_create(struct gb_host_device *hd,
u8 interface_id);
int gb_interface_init(struct gb_interface *intf);
+int gb_interface_add(struct gb_interface *intf);
void gb_interface_remove(struct gb_interface *intf);
void gb_interfaces_remove(struct gb_host_device *hd);