void gb_hd_del(struct gb_host_device *hd) { /* * Tear down the svc and flush any on-going hotplug processing before * removing the remaining interfaces. */ gb_svc_del(hd->svc); gb_interfaces_remove(hd); device_del(&hd->dev); }
void greybus_remove_hd(struct greybus_host_device *hd) { /* * Tear down all interfaces, modules, and the endo that is associated * with this host controller before freeing the memory associated with * the host controller. */ gb_interfaces_remove(hd); gb_endo_remove(hd->endo); /* Is the SVC still using the partially uninitialized connection ? */ if (hd->initial_svc_connection) gb_connection_destroy(hd->initial_svc_connection); /* * Make sure there are no leftovers that can potentially corrupt sysfs. */ if (WARN_ON(!list_empty(&hd->connections))) gb_hd_connections_exit(hd); kref_put_mutex(&hd->kref, free_hd, &hd_mutex); }