/* Returns: 0: transport successfully registered -EEXIST: transport already registered -EINVAL: transport module being unloaded  */
int xprt_register_transport(struct xprt_class *transport)
/* Returns: 0: transport successfully registered -EEXIST: transport already registered -EINVAL: transport module being unloaded  */
int xprt_register_transport(struct xprt_class *transport)
{
	struct xprt_class *t;
	int result;
	result = -EEXIST;
	spin_lock(&xprt_list_lock);
	list_for_each_entry(t, &xprt_list, list) {
		if (t->ident == transport->ident)
			goto out;
	}
	list_add_tail(&transport->list, &xprt_list);
	printk(KERN_INFO "RPC: Registered %s transport module.\n",
	       transport->name);
	result = 0;
out:
	spin_unlock(&xprt_list_lock);
	return result;
}