Commit a0ff86b8 authored by Chas Williams's avatar Chas Williams Committed by Stephen Hemminger

[ATM]: remove MOD_* used as semaphore; convert others to new style

parent b6301f43
...@@ -132,7 +132,7 @@ static void pppoatm_unassign_vcc(struct atm_vcc *atmvcc) ...@@ -132,7 +132,7 @@ static void pppoatm_unassign_vcc(struct atm_vcc *atmvcc)
atmvcc->user_back = NULL; atmvcc->user_back = NULL;
kfree(pvcc); kfree(pvcc);
/* Gee, I hope we have the big kernel lock here... */ /* Gee, I hope we have the big kernel lock here... */
MOD_DEC_USE_COUNT; module_put(THIS_MODULE);
} }
/* Called when an AAL5 PDU comes in */ /* Called when an AAL5 PDU comes in */
...@@ -286,12 +286,9 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, unsigned long arg) ...@@ -286,12 +286,9 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, unsigned long arg)
if (be.encaps != PPPOATM_ENCAPS_AUTODETECT && if (be.encaps != PPPOATM_ENCAPS_AUTODETECT &&
be.encaps != PPPOATM_ENCAPS_VC && be.encaps != PPPOATM_ENCAPS_LLC) be.encaps != PPPOATM_ENCAPS_VC && be.encaps != PPPOATM_ENCAPS_LLC)
return -EINVAL; return -EINVAL;
MOD_INC_USE_COUNT;
pvcc = kmalloc(sizeof(*pvcc), GFP_KERNEL); pvcc = kmalloc(sizeof(*pvcc), GFP_KERNEL);
if (pvcc == NULL) { if (pvcc == NULL)
MOD_DEC_USE_COUNT;
return -ENOMEM; return -ENOMEM;
}
memset(pvcc, 0, sizeof(*pvcc)); memset(pvcc, 0, sizeof(*pvcc));
pvcc->atmvcc = atmvcc; pvcc->atmvcc = atmvcc;
pvcc->old_push = atmvcc->push; pvcc->old_push = atmvcc->push;
...@@ -310,6 +307,7 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, unsigned long arg) ...@@ -310,6 +307,7 @@ static int pppoatm_assign_vcc(struct atm_vcc *atmvcc, unsigned long arg)
atmvcc->user_back = pvcc; atmvcc->user_back = pvcc;
atmvcc->push = pppoatm_push; atmvcc->push = pppoatm_push;
atmvcc->pop = pppoatm_pop; atmvcc->pop = pppoatm_pop;
(void) try_module_get(THIS_MODULE);
return 0; return 0;
} }
......
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