/* Returns: 0 on success or a negative value on failure  */
static void __exit fcoe_exit(void)
/* Returns: 0 on success or a negative value on failure  */
static void __exit fcoe_exit(void)
{
	struct fcoe_interface *fcoe, *tmp;
	struct fcoe_port *port;
	unsigned int cpu;
	mutex_lock(&fcoe_config_mutex);
	fcoe_dev_cleanup();
	rtnl_lock();
	list_for_each_entry_safe(fcoe, tmp, &fcoe_hostlist, list) {
		list_del(&fcoe->list);
		port = lport_priv(fcoe->ctlr.lp);
		fcoe_interface_cleanup(fcoe);
		schedule_work(&port->destroy_work);
	}
	rtnl_unlock();
	unregister_hotcpu_notifier(&fcoe_cpu_notifier);
	for_each_online_cpu(cpu)
		fcoe_percpu_thread_destroy(cpu);
	mutex_unlock(&fcoe_config_mutex);
	flush_scheduled_work();
	flush_scheduled_work();
	fcoe_if_exit();
}