o llc: remove MOD_{INC,DEC}_USE_COUNT

Now the core networking infrastructure will (finally) do that for the net
protocol families, its just a matter of setting the ->owner field in the
registered struct net_proto_family to THIS_MODULE.
parent b1ee64fe
...@@ -43,16 +43,15 @@ struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb, ...@@ -43,16 +43,15 @@ struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb,
/* verify this SAP is not already open; if so, return error */ /* verify this SAP is not already open; if so, return error */
struct llc_sap *sap; struct llc_sap *sap;
MOD_INC_USE_COUNT;
sap = llc_sap_find(lsap); sap = llc_sap_find(lsap);
if (sap) { /* SAP already exists */ if (sap) { /* SAP already exists */
sap = NULL; sap = NULL;
goto err; goto out;
} }
/* sap requested does not yet exist */ /* sap requested does not yet exist */
sap = llc_sap_alloc(); sap = llc_sap_alloc();
if (!sap) if (!sap)
goto err; goto out;
/* allocated a SAP; initialize it and clear out its memory pool */ /* allocated a SAP; initialize it and clear out its memory pool */
sap->laddr.lsap = lsap; sap->laddr.lsap = lsap;
sap->rcv_func = func; sap->rcv_func = func;
...@@ -61,9 +60,6 @@ struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb, ...@@ -61,9 +60,6 @@ struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb,
llc_sap_save(sap); llc_sap_save(sap);
out: out:
return sap; return sap;
err:
MOD_DEC_USE_COUNT;
goto out;
} }
/** /**
...@@ -76,7 +72,6 @@ struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb, ...@@ -76,7 +72,6 @@ struct llc_sap *llc_sap_open(u8 lsap, int (*func)(struct sk_buff *skb,
void llc_sap_close(struct llc_sap *sap) void llc_sap_close(struct llc_sap *sap)
{ {
llc_free_sap(sap); llc_free_sap(sap);
MOD_DEC_USE_COUNT;
} }
/** /**
......
...@@ -224,9 +224,8 @@ struct sock *llc_sk_alloc(int family, int priority) ...@@ -224,9 +224,8 @@ struct sock *llc_sk_alloc(int family, int priority)
{ {
struct sock *sk = sk_alloc(family, priority, 1, NULL); struct sock *sk = sk_alloc(family, priority, 1, NULL);
MOD_INC_USE_COUNT;
if (!sk) if (!sk)
goto decmod; goto out;
if (llc_sk_init(sk)) if (llc_sk_init(sk))
goto outsk; goto outsk;
sock_init_data(NULL, sk); sock_init_data(NULL, sk);
...@@ -240,8 +239,6 @@ struct sock *llc_sk_alloc(int family, int priority) ...@@ -240,8 +239,6 @@ struct sock *llc_sk_alloc(int family, int priority)
outsk: outsk:
sk_free(sk); sk_free(sk);
sk = NULL; sk = NULL;
decmod:
MOD_DEC_USE_COUNT;
goto out; goto out;
} }
...@@ -279,7 +276,6 @@ void llc_sk_free(struct sock *sk) ...@@ -279,7 +276,6 @@ void llc_sk_free(struct sock *sk)
} }
#endif #endif
sock_put(sk); sock_put(sk);
MOD_DEC_USE_COUNT;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment