Lines Matching refs:cp
120 const struct can_proto *cp; in can_get_proto() local
123 cp = rcu_dereference(proto_tab[protocol]); in can_get_proto()
124 if (cp && !try_module_get(cp->prot->owner)) in can_get_proto()
125 cp = NULL; in can_get_proto()
128 return cp; in can_get_proto()
131 static inline void can_put_proto(const struct can_proto *cp) in can_put_proto() argument
133 module_put(cp->prot->owner); in can_put_proto()
140 const struct can_proto *cp; in can_create() local
151 cp = can_get_proto(protocol); in can_create()
154 if (!cp) { in can_create()
168 cp = can_get_proto(protocol); in can_create()
174 if (!cp) in can_create()
177 if (cp->type != sock->type) { in can_create()
182 sock->ops = cp->ops; in can_create()
184 sk = sk_alloc(net, PF_CAN, GFP_KERNEL, cp->prot, kern); in can_create()
203 can_put_proto(cp); in can_create()
771 int can_proto_register(const struct can_proto *cp) in can_proto_register() argument
773 int proto = cp->protocol; in can_proto_register()
781 err = proto_register(cp->prot, 0); in can_proto_register()
791 RCU_INIT_POINTER(proto_tab[proto], cp); in can_proto_register()
796 proto_unregister(cp->prot); in can_proto_register()
806 void can_proto_unregister(const struct can_proto *cp) in can_proto_unregister() argument
808 int proto = cp->protocol; in can_proto_unregister()
811 BUG_ON(proto_tab[proto] != cp); in can_proto_unregister()
817 proto_unregister(cp->prot); in can_proto_unregister()