
From: "Paul E. McKenney" <paulmck@us.ibm.com>

Removes lots of `#ifdef LINUX_2_2' stuff.


 sound/core/control.c           |    2 
 sound/core/hwdep.c             |    2 
 sound/core/info.c              |  110 -----------------------------------------
 sound/core/init.c              |    2 
 sound/core/oss/mixer_oss.c     |    2 
 sound/core/oss/pcm_oss.c       |    2 
 sound/core/pcm_native.c        |    0 
 sound/core/rawmidi.c           |    2 
 sound/core/seq/oss/seq_oss.c   |    2 
 sound/core/seq/seq_clientmgr.c |    2 
 sound/core/seq/seq_memory.c    |   11 ----
 sound/core/sound.c             |    2 
 sound/core/timer.c             |    2 
 13 files changed, 1 insertion(+), 140 deletions(-)

diff -puN sound/core/control.c~remove-LINUX_2_2 sound/core/control.c
--- 25/sound/core/control.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/control.c	2003-05-30 23:28:11.000000000 -0700
@@ -931,9 +931,7 @@ static int snd_ctl_fasync(int fd, struct
 
 static struct file_operations snd_ctl_f_ops =
 {
-#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
-#endif
 	.read =		snd_ctl_read,
 	.open =		snd_ctl_open,
 	.release =	snd_ctl_release,
diff -puN sound/core/hwdep.c~remove-LINUX_2_2 sound/core/hwdep.c
--- 25/sound/core/hwdep.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/hwdep.c	2003-05-30 23:28:11.000000000 -0700
@@ -292,9 +292,7 @@ static int snd_hwdep_control_ioctl(snd_c
 
 static struct file_operations snd_hwdep_f_ops =
 {
-#ifndef LINUX_2_2
 	.owner = 	THIS_MODULE,
-#endif
 	.llseek =	snd_hwdep_llseek,
 	.read = 	snd_hwdep_read,
 	.write =	snd_hwdep_write,
diff -puN sound/core/info.c~remove-LINUX_2_2 sound/core/info.c
--- 25/sound/core/info.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/info.c	2003-05-30 23:28:11.000000000 -0700
@@ -126,27 +126,6 @@ snd_info_entry_t *snd_seq_root = NULL;
 snd_info_entry_t *snd_oss_root = NULL;
 #endif
 
-#ifdef LINUX_2_2
-static void snd_info_fill_inode(struct inode *inode, int fill)
-{
-	if (fill)
-		MOD_INC_USE_COUNT;
-	else
-		MOD_DEC_USE_COUNT;
-}
-
-static inline void snd_info_entry_prepare(struct proc_dir_entry *de)
-{
-	de->fill_inode = snd_info_fill_inode;
-}
-
-void snd_remove_proc_entry(struct proc_dir_entry *parent,
-			   struct proc_dir_entry *de)
-{
-	if (parent && de)
-		proc_unregister(parent, de->low_ino);
-}
-#else
 static inline void snd_info_entry_prepare(struct proc_dir_entry *de)
 {
 	de->owner = THIS_MODULE;
@@ -158,7 +137,6 @@ void snd_remove_proc_entry(struct proc_d
 	if (de)
 		remove_proc_entry(de->name, parent);
 }
-#endif
 
 static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
 {
@@ -520,9 +498,7 @@ static int snd_info_entry_mmap(struct fi
 
 static struct file_operations snd_info_entry_operations =
 {
-#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
-#endif
 	.llseek =	snd_info_entry_llseek,
 	.read =		snd_info_entry_read,
 	.write =	snd_info_entry_write,
@@ -533,67 +509,22 @@ static struct file_operations snd_info_e
 	.release =	snd_info_entry_release,
 };
 
-#ifdef LINUX_2_2
-static struct inode_operations snd_info_entry_inode_operations =
-{
-	&snd_info_entry_operations,	/* default sound info directory file-ops */
-};
-
-static struct inode_operations snd_info_device_inode_operations =
-{
-	&snd_fops,		/* default sound info directory file-ops */
-};
-#endif	/* LINUX_2_2 */
-
 static int snd_info_card_readlink(struct dentry *dentry,
 				  char *buffer, int buflen)
 {
         char *s = PDE(dentry->d_inode)->data;
-#ifndef LINUX_2_2
 	return vfs_readlink(dentry, buffer, buflen, s);
-#else
-	int len;
-	
-	if (s == NULL)
-		return -EIO;
-	len = strlen(s);
-	if (len > buflen)
-		len = buflen;
-	if (copy_to_user(buffer, s, len))
-		return -EFAULT;
-	return len;
-#endif
 }
 
-#ifndef LINUX_2_2
 static int snd_info_card_followlink(struct dentry *dentry,
 				    struct nameidata *nd)
 {
-        char *s = PDE(dentry->d_inode)->data;
-        return vfs_follow_link(nd, s);
-}
-#else
-static struct dentry *snd_info_card_followlink(struct dentry *dentry,
-					       struct dentry *base,
-					       unsigned int follow)
-{
 	char *s = PDE(dentry->d_inode)->data;
-	return lookup_dentry(s, base, follow);
+	return vfs_follow_link(nd, s);
 }
-#endif
-
-#ifdef LINUX_2_2
-static struct file_operations snd_info_card_link_operations =
-{
-	NULL
-};
-#endif
 
 struct inode_operations snd_info_card_link_inode_operations =
 {
-#ifdef LINUX_2_2
-	.default_file_ops =	&snd_info_card_link_operations,
-#endif
 	.readlink =		snd_info_card_readlink,
 	.follow_link =		snd_info_card_followlink,
 };
@@ -744,12 +675,8 @@ int snd_info_card_register(snd_card_t * 
 	if (p == NULL)
 		return -ENOMEM;
 	p->data = s;
-#ifndef LINUX_2_2
 	p->owner = card->module;
 	p->proc_iops = &snd_info_card_link_inode_operations;
-#else
-	p->ops = &snd_info_card_link_inode_operations;
-#endif
 	card->proc_root_link = p;
 	return 0;
 }
@@ -1008,40 +935,11 @@ void snd_info_free_entry(snd_info_entry_
 	snd_magic_kfree(entry);
 }
 
-#ifdef LINUX_2_2
-static void snd_info_device_fill_inode(struct inode *inode, int fill)
-{
-	struct proc_dir_entry *de;
-	snd_info_entry_t *entry;
-
-	if (!fill) {
-		MOD_DEC_USE_COUNT;
-		return;
-	}
-	MOD_INC_USE_COUNT;
-	de = PDE(inode);
-	if (de == NULL)
-		return;
-	entry = (snd_info_entry_t *) de->data;
-	if (entry == NULL)
-		return;
-	inode->i_gid = device_gid;
-	inode->i_uid = device_uid;
-	inode->i_rdev = MKDEV(entry->c.device.major, entry->c.device.minor);
-}
-
-static inline void snd_info_device_entry_prepare(struct proc_dir_entry *de, snd_info_entry_t *entry)
-{
-	de->fill_inode = snd_info_device_fill_inode;
-	de->ops = &snd_info_device_inode_operations;
-}
-#else
 static inline void snd_info_device_entry_prepare(struct proc_dir_entry *de, snd_info_entry_t *entry)
 {
 	de->rdev = mk_kdev(entry->c.device.major, entry->c.device.minor);
 	de->owner = THIS_MODULE;
 }
-#endif /* LINUX_2_2 */
 
 /*
  * create a procfs device file
@@ -1119,15 +1017,9 @@ int snd_info_register(snd_info_entry_t *
 		up(&info_mutex);
 		return -ENOMEM;
 	}
-#ifndef LINUX_2_2
 	p->owner = entry->module;
-#endif
 	if (!S_ISDIR(entry->mode)) {
-#ifndef LINUX_2_2
 		p->proc_fops = &snd_info_entry_operations;
-#else
-		p->ops = &snd_info_entry_inode_operations;
-#endif
 	}
 	p->size = entry->size;
 	p->data = entry;
diff -puN sound/core/init.c~remove-LINUX_2_2 sound/core/init.c
--- 25/sound/core/init.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/init.c	2003-05-30 23:28:11.000000000 -0700
@@ -193,9 +193,7 @@ int snd_card_disconnect(snd_card_t * car
 		f_ops = &s_f_ops->f_ops;
 
 		memset(f_ops, 0, sizeof(*f_ops));
-#ifndef LINUX_2_2
 		f_ops->owner = file->f_op->owner;
-#endif
 		f_ops->release = file->f_op->release;
 		f_ops->poll = snd_disconnect_poll;
 
diff -puN sound/core/oss/mixer_oss.c~remove-LINUX_2_2 sound/core/oss/mixer_oss.c
--- 25/sound/core/oss/mixer_oss.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/oss/mixer_oss.c	2003-05-30 23:28:11.000000000 -0700
@@ -376,9 +376,7 @@ int snd_mixer_oss_ioctl_card(snd_card_t 
 
 static struct file_operations snd_mixer_oss_f_ops =
 {
-#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
-#endif
 	.open =		snd_mixer_oss_open,
 	.release =	snd_mixer_oss_release,
 	.ioctl =	snd_mixer_oss_ioctl,
diff -puN sound/core/oss/pcm_oss.c~remove-LINUX_2_2 sound/core/oss/pcm_oss.c
--- 25/sound/core/oss/pcm_oss.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/oss/pcm_oss.c	2003-05-30 23:28:11.000000000 -0700
@@ -2148,9 +2148,7 @@ static void snd_pcm_oss_proc_done(snd_pc
 
 static struct file_operations snd_pcm_oss_f_reg =
 {
-#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
-#endif
 	.read =		snd_pcm_oss_read,
 	.write =	snd_pcm_oss_write,
 	.open =		snd_pcm_oss_open,
diff -puN sound/core/pcm_native.c~remove-LINUX_2_2 sound/core/pcm_native.c
diff -puN sound/core/rawmidi.c~remove-LINUX_2_2 sound/core/rawmidi.c
--- 25/sound/core/rawmidi.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/rawmidi.c	2003-05-30 23:28:11.000000000 -0700
@@ -1316,9 +1316,7 @@ static void snd_rawmidi_proc_info_read(s
 
 static struct file_operations snd_rawmidi_f_ops =
 {
-#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
-#endif
 	.read =		snd_rawmidi_read,
 	.write =	snd_rawmidi_write,
 	.open =		snd_rawmidi_open,
diff -puN sound/core/seq/oss/seq_oss.c~remove-LINUX_2_2 sound/core/seq/oss/seq_oss.c
--- 25/sound/core/seq/oss/seq_oss.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/seq/oss/seq_oss.c	2003-05-30 23:28:11.000000000 -0700
@@ -194,9 +194,7 @@ odev_poll(struct file *file, poll_table 
 
 static struct file_operations seq_oss_f_ops =
 {
-#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
-#endif
 	.read =		odev_read,
 	.write =	odev_write,
 	.open =		odev_open,
diff -puN sound/core/seq/seq_clientmgr.c~remove-LINUX_2_2 sound/core/seq/seq_clientmgr.c
--- 25/sound/core/seq/seq_clientmgr.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/seq/seq_clientmgr.c	2003-05-30 23:28:11.000000000 -0700
@@ -2454,9 +2454,7 @@ void snd_seq_info_clients_read(snd_info_
 
 static struct file_operations snd_seq_f_ops =
 {
-#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
-#endif
 	.read =		snd_seq_read,
 	.write =	snd_seq_write,
 	.open =		snd_seq_open,
diff -puN sound/core/seq/seq_memory.c~remove-LINUX_2_2 sound/core/seq/seq_memory.c
--- 25/sound/core/seq/seq_memory.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/seq/seq_memory.c	2003-05-30 23:28:11.000000000 -0700
@@ -235,18 +235,7 @@ int snd_seq_cell_alloc(pool_t *pool, snd
 	while (pool->free == NULL && ! nonblock && ! pool->closing) {
 
 		spin_unlock(&pool->lock);
-#ifdef LINUX_2_2
-		/* change semaphore to allow other clients
-		   to access device file */
-		if (file)
-			up(&semaphore_of(file));
-#endif
 		interruptible_sleep_on(&pool->output_sleep);
-#ifdef LINUX_2_2
-		/* restore semaphore again */
-		if (file)
-			down(&semaphore_of(file));
-#endif
 		spin_lock(&pool->lock);
 		/* interrupted? */
 		if (signal_pending(current)) {
diff -puN sound/core/sound.c~remove-LINUX_2_2 sound/core/sound.c
--- 25/sound/core/sound.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/sound.c	2003-05-30 23:28:11.000000000 -0700
@@ -157,9 +157,7 @@ static int snd_open(struct inode *inode,
 
 struct file_operations snd_fops =
 {
-#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
-#endif
 	.open =		snd_open
 };
 
diff -puN sound/core/timer.c~remove-LINUX_2_2 sound/core/timer.c
--- 25/sound/core/timer.c~remove-LINUX_2_2	2003-05-30 23:28:11.000000000 -0700
+++ 25-akpm/sound/core/timer.c	2003-05-30 23:28:11.000000000 -0700
@@ -1733,9 +1733,7 @@ static unsigned int snd_timer_user_poll(
 
 static struct file_operations snd_timer_f_ops =
 {
-#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
-#endif
 	.read =		snd_timer_user_read,
 	.open =		snd_timer_user_open,
 	.release =	snd_timer_user_release,

_
