Update of /cvsroot/alsa/alsa-kernel/core/seq
In directory sc8-pr-cvs1:/tmp/cvs-serv17151/core/seq

Modified Files:
        seq_clientmgr.c seq_ports.c seq_virmidi.c 
Log Message:
- rewritten with the new module functions for 2.5 kernel,
  try_module_get() and module_put().
- clean up unnecessary MOD_INC_USE_COUNT and DEC_COUNT for 2.2 kernels.



Index: seq_clientmgr.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/seq/seq_clientmgr.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- seq_clientmgr.c     22 Oct 2002 08:52:16 -0000      1.17
+++ seq_clientmgr.c     19 Dec 2002 15:59:17 -0000      1.18
@@ -339,10 +339,6 @@
        /* make others aware this new client */
        snd_seq_system_client_ev_client_start(c);
 
-#ifdef LINUX_2_2
-       MOD_INC_USE_COUNT;
-#endif
-
        return 0;
 }
 
@@ -358,9 +354,6 @@
                kfree(client);
        }
 
-#ifdef LINUX_2_2
-       MOD_DEC_USE_COUNT;
-#endif
        return 0;
 }
 

Index: seq_ports.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/seq/seq_ports.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- seq_ports.c 12 Aug 2002 08:43:45 -0000      1.10
+++ seq_ports.c 19 Dec 2002 15:59:17 -0000      1.11
@@ -55,12 +55,6 @@
 
 */
 
-static inline void dec_mod_count(struct module *module)
-{
-       if (module)
-               __MOD_DEC_USE_COUNT(module);
-}
-
 /* return pointer to port structure - port is locked if found */
 client_port_t *snd_seq_port_use_ptr(client_t *client, int num)
 {
@@ -407,13 +401,13 @@
 {
        int err = 0;
 
-       if (!try_inc_mod_count(port->owner))
+       if (!try_module_get(port->owner))
                return -EFAULT;
        grp->count++;
        if (grp->open && (port->callback_all || grp->count == 1)) {
                err = grp->open(port->private_data, info);
                if (err < 0) {
-                       dec_mod_count(port->owner);
+                       module_put(port->owner);
                        grp->count--;
                }
        }
@@ -438,7 +432,7 @@
        if (send_ack && client->type == USER_CLIENT)
                snd_seq_client_notify_subscription(port->addr.client, port->addr.port,
                                                   info, 
SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED);
-       dec_mod_count(port->owner);
+       module_put(port->owner);
        return err;
 }
 

Index: seq_virmidi.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/seq/seq_virmidi.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- seq_virmidi.c       13 Aug 2002 16:13:35 -0000      1.10
+++ seq_virmidi.c       19 Dec 2002 15:59:17 -0000      1.11
@@ -53,12 +53,6 @@
 MODULE_DESCRIPTION("Virtual Raw MIDI client on Sequencer");
 MODULE_LICENSE("GPL");
 
-static inline void dec_mod_count(struct module *module)
-{
-       if (module)
-               __MOD_DEC_USE_COUNT(module);
-}
-
 /*
  * initialize an event record
  */
@@ -288,7 +282,7 @@
        snd_virmidi_dev_t *rdev;
 
        rdev = snd_magic_cast(snd_virmidi_dev_t, private_data, return -EINVAL);
-       if (!try_inc_mod_count(rdev->card->module))
+       if (!try_module_get(rdev->card->module))
                return -EFAULT;
        rdev->flags |= SNDRV_VIRMIDI_SUBSCRIBE;
        return 0;
@@ -303,7 +297,7 @@
 
        rdev = snd_magic_cast(snd_virmidi_dev_t, private_data, return -EINVAL);
        rdev->flags &= ~SNDRV_VIRMIDI_SUBSCRIBE;
-       dec_mod_count(rdev->card->module);
+       module_put(rdev->card->module);
        return 0;
 }
 
@@ -316,7 +310,7 @@
        snd_virmidi_dev_t *rdev;
 
        rdev = snd_magic_cast(snd_virmidi_dev_t, private_data, return -EINVAL);
-       if (!try_inc_mod_count(rdev->card->module))
+       if (!try_module_get(rdev->card->module))
                return -EFAULT;
        rdev->flags |= SNDRV_VIRMIDI_USE;
        return 0;
@@ -331,7 +325,7 @@
 
        rdev = snd_magic_cast(snd_virmidi_dev_t, private_data, return -EINVAL);
        rdev->flags &= ~SNDRV_VIRMIDI_USE;
-       dec_mod_count(rdev->card->module);
+       module_put(rdev->card->module);
        return 0;
 }
 



-------------------------------------------------------
This SF.NET email is sponsored by: Geek Gift Procrastinating?
Get the perfect geek gift now!  Before the Holidays pass you by.
T H I N K G E E K . C O M      http://www.thinkgeek.com/sf/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to