public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* MINOR(inode->i_rdev) vs. minor(inode->i_rdev)
@ 2002-01-09 19:20 Brendan Burns
  2002-01-09 19:55 ` Nikita Gergel
  0 siblings, 1 reply; 2+ messages in thread
From: Brendan Burns @ 2002-01-09 19:20 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

Hello,
In the process of compiling ALSA for my new 2.5.2pre10 kernel I noticed
that MINOR(inode->i_rdev) causes compile errors and should be replaced
with minor(inode->i_rdev) Looking at a number of the OSS sound drivers
in the kernel I noticed that they to would not compile in 2.5.2pre10 (eg
Turtle Beach Pinnacle)  I fixed all of these modules and a patch is
attached.  However, looking further I noticed that there were similar
problems in a number of other drivers.  Before I undertook cleaning all
of them I thought I would check in and make sure I was doing the right
thing.  Namely that every instance of MINOR(inode->i_rdev) or
MINOR(i_rdev) should be replaced with minor(inode->i_rdev) or
minor(i_rdev).

Please CC me on any replies since I am not subscribed to the list.
Thanks,
Brendan




[-- Attachment #2: sound-patch --]
[-- Type: text/x-patch, Size: 9180 bytes --]

diff -uNr linux/drivers/sound/btaudio.c linux.new/drivers/sound/btaudio.c
--- linux/drivers/sound/btaudio.c	Wed Oct 17 17:19:20 2001
+++ linux.new/drivers/sound/btaudio.c	Wed Jan  9 13:57:09 2002
@@ -300,7 +300,7 @@
 
 static int btaudio_mixer_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct btaudio *bta;
 
 	for (bta = btaudios; bta != NULL; bta = bta->next)
@@ -459,7 +459,7 @@
 
 static int btaudio_dsp_open_digital(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct btaudio *bta;
 
 	for (bta = btaudios; bta != NULL; bta = bta->next)
@@ -475,7 +475,7 @@
 
 static int btaudio_dsp_open_analog(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct btaudio *bta;
 
 	for (bta = btaudios; bta != NULL; bta = bta->next)
diff -uNr linux/drivers/sound/cmpci.c linux.new/drivers/sound/cmpci.c
--- linux/drivers/sound/cmpci.c	Sun Nov 25 13:17:47 2001
+++ linux.new/drivers/sound/cmpci.c	Wed Jan  9 13:54:59 2002
@@ -1440,7 +1440,7 @@
 
 static int cm_open_mixdev(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct cm_state *s = devs;
 
 	while (s && s->dev_mixer != minor)
@@ -2190,7 +2190,7 @@
 
 static int cm_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct cm_state *s = devs;
 	unsigned char fmtm = ~0, fmts = 0;
 
@@ -2445,7 +2445,7 @@
 
 static int cm_midi_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct cm_state *s = devs;
 	unsigned long flags;
 
@@ -2662,7 +2662,7 @@
 
 static int cm_dmfm_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct cm_state *s = devs;
 
 	while (s && s->dev_dmfm != minor)
diff -uNr linux/drivers/sound/ite8172.c linux.new/drivers/sound/ite8172.c
--- linux/drivers/sound/ite8172.c	Thu Oct 25 16:53:52 2001
+++ linux.new/drivers/sound/ite8172.c	Wed Jan  9 13:57:22 2002
@@ -832,7 +832,7 @@
 
 static int it8172_open_mixdev(struct inode *inode, struct file *file)
 {
-    int minor = MINOR(inode->i_rdev);
+    int minor = minor(inode->i_rdev);
     struct list_head *list;
     struct it8172_state *s;
 
@@ -1543,7 +1543,7 @@
 
 static int it8172_open(struct inode *inode, struct file *file)
 {
-    int minor = MINOR(inode->i_rdev);
+    int minor = minor(inode->i_rdev);
     DECLARE_WAITQUEUE(wait, current);
     unsigned long flags;
     struct list_head *list;
diff -uNr linux/drivers/sound/msnd_pinnacle.c linux.new/drivers/sound/msnd_pinnacle.c
--- linux/drivers/sound/msnd_pinnacle.c	Sun Sep 30 15:26:08 2001
+++ linux.new/drivers/sound/msnd_pinnacle.c	Wed Jan  9 13:54:12 2002
@@ -641,7 +641,7 @@
 
 static int dev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 
 	if (cmd == OSS_GETVERSION) {
 		int sound_version = SOUND_VERSION;
@@ -753,7 +753,7 @@
 
 static int dev_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	int err = 0;
 
 	if (minor == dev.dsp_minor) {
@@ -788,7 +788,7 @@
 
 static int dev_release(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	int err = 0;
 
 	lock_kernel();
@@ -978,7 +978,7 @@
 
 static ssize_t dev_read(struct file *file, char *buf, size_t count, loff_t *off)
 {
-	int minor = MINOR(file->f_dentry->d_inode->i_rdev);
+	int minor = minor(file->f_dentry->d_inode->i_rdev);
 	if (minor == dev.dsp_minor)
 		return dsp_read(buf, count);
 	else
@@ -987,7 +987,7 @@
 
 static ssize_t dev_write(struct file *file, const char *buf, size_t count, loff_t *off)
 {
-	int minor = MINOR(file->f_dentry->d_inode->i_rdev);
+	int minor = minor(file->f_dentry->d_inode->i_rdev);
 	if (minor == dev.dsp_minor)
 		return dsp_write(buf, count);
 	else
diff -uNr linux/drivers/sound/nec_vrc5477.c linux.new/drivers/sound/nec_vrc5477.c
--- linux/drivers/sound/nec_vrc5477.c	Thu Oct 25 16:53:52 2001
+++ linux.new/drivers/sound/nec_vrc5477.c	Wed Jan  9 13:57:32 2002
@@ -813,7 +813,7 @@
 
 static int vrc5477_ac97_open_mixdev(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct list_head *list;
 	struct vrc5477_ac97_state *s;
 
@@ -1529,7 +1529,7 @@
 
 static int vrc5477_ac97_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	DECLARE_WAITQUEUE(wait, current);
 	unsigned long flags;
 	struct list_head *list;
diff -uNr linux/drivers/sound/rme96xx.c linux.new/drivers/sound/rme96xx.c
--- linux/drivers/sound/rme96xx.c	Thu Oct 25 16:53:52 2001
+++ linux.new/drivers/sound/rme96xx.c	Wed Jan  9 13:56:13 2002
@@ -1162,7 +1162,7 @@
 
 static int rme96xx_open(struct inode *in, struct file *f)
 {
-	int minor = MINOR(in->i_rdev);
+	int minor = minor(in->i_rdev);
 	struct list_head *list;
 	int devnum = ((minor-3)/16) % devices; /* default = 0 */
 	rme96xx_info *s;
@@ -1490,7 +1490,7 @@
 
 static int rme96xx_mixer_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct list_head *list;
 	rme96xx_info *s;
 
diff -uNr linux/drivers/sound/sonicvibes.c linux.new/drivers/sound/sonicvibes.c
--- linux/drivers/sound/sonicvibes.c	Sun Sep 30 15:26:08 2001
+++ linux.new/drivers/sound/sonicvibes.c	Wed Jan  9 13:54:36 2002
@@ -1235,7 +1235,7 @@
 
 static int sv_open_mixdev(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct list_head *list;
 	struct sv_state *s;
 
@@ -1893,7 +1893,7 @@
 
 static int sv_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	DECLARE_WAITQUEUE(wait, current);
 	unsigned char fmtm = ~0, fmts = 0;
 	struct list_head *list;
@@ -2142,7 +2142,7 @@
 
 static int sv_midi_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	DECLARE_WAITQUEUE(wait, current);
 	unsigned long flags;
 	struct list_head *list;
@@ -2364,7 +2364,7 @@
 
 static int sv_dmfm_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	DECLARE_WAITQUEUE(wait, current);
 	struct list_head *list;
 	struct sv_state *s;
diff -uNr linux/drivers/sound/trident.c linux.new/drivers/sound/trident.c
--- linux/drivers/sound/trident.c	Tue Nov 13 12:19:41 2001
+++ linux.new/drivers/sound/trident.c	Wed Jan  9 13:55:47 2002
@@ -2555,7 +2555,7 @@
 static int trident_open(struct inode *inode, struct file *file)
 {
 	int i = 0;
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct trident_card *card = devs;
 	struct trident_state *state = NULL;
 	struct dmabuf *dmabuf = NULL;
@@ -3750,7 +3750,7 @@
 static int trident_open_mixdev(struct inode *inode, struct file *file)
 {
 	int i = 0;
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct trident_card *card = devs;
 
 	for (card = devs; card != NULL; card = card->next)
diff -uNr linux/drivers/sound/via82cxxx_audio.c linux.new/drivers/sound/via82cxxx_audio.c
--- linux/drivers/sound/via82cxxx_audio.c	Mon Dec 10 13:39:20 2001
+++ linux.new/drivers/sound/via82cxxx_audio.c	Wed Jan  9 13:53:44 2002
@@ -1358,7 +1358,7 @@
 
 static int via_mixer_open (struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct via_info *card;
 	struct pci_dev *pdev;
 	struct pci_driver *drvr;
@@ -2974,7 +2974,7 @@
 
 static int via_dsp_open (struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct via_info *card;
 	struct pci_dev *pdev;
 	struct via_channel *chan;
diff -uNr linux/drivers/sound/vwsnd.c linux.new/drivers/sound/vwsnd.c
--- linux/drivers/sound/vwsnd.c	Fri Nov  9 17:07:41 2001
+++ linux.new/drivers/sound/vwsnd.c	Wed Jan  9 13:57:43 2002
@@ -2907,7 +2907,7 @@
 static int vwsnd_audio_open(struct inode *inode, struct file *file)
 {
 	vwsnd_dev_t *devc;
-	dev_t minor = MINOR(inode->i_rdev);
+	dev_t minor = minor(inode->i_rdev);
 	int sw_samplefmt;
 
 	DBGE("(inode=0x%p, file=0x%p)\n", inode, file);
@@ -3054,7 +3054,7 @@
 
 	INC_USE_COUNT;
 	for (devc = vwsnd_dev_list; devc; devc = devc->next_dev)
-		if (devc->mixer_minor == MINOR(inode->i_rdev))
+		if (devc->mixer_minor == minor(inode->i_rdev))
 			break;
 
 	if (devc == NULL) {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: MINOR(inode->i_rdev) vs. minor(inode->i_rdev)
  2002-01-09 19:20 MINOR(inode->i_rdev) vs. minor(inode->i_rdev) Brendan Burns
@ 2002-01-09 19:55 ` Nikita Gergel
  0 siblings, 0 replies; 2+ messages in thread
From: Nikita Gergel @ 2002-01-09 19:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Brendan Burns

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

On 09 Jan 2002 14:20:23 -0500
Brendan Burns <bburns@eksl.cs.umass.edu> wrote:

> Hello,
Hello!

> In the process of compiling ALSA for my new 2.5.2pre10 kernel I noticed
> that MINOR(inode->i_rdev) causes compile errors and should be replaced
> with minor(inode->i_rdev) Looking at a number of the OSS sound drivers
> in the kernel I noticed that they to would not compile in 2.5.2pre10 (eg
> Turtle Beach Pinnacle)  I fixed all of these modules and a patch is
> attached.  However, looking further I noticed that there were similar
> problems in a number of other drivers.  Before I undertook cleaning all
> of them I thought I would check in and make sure I was doing the right
> thing.  Namely that every instance of MINOR(inode->i_rdev) or
> MINOR(i_rdev) should be replaced with minor(inode->i_rdev) or
> minor(i_rdev).

I've contributed patch for emu10k1, because tests after 'MINOR' replacement successed. You're on the right way.

Regards.

-- 
Nikita Gergel					System Administrator
Moscow, Russia					YAUZA-Telecom

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-09 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-09 19:20 MINOR(inode->i_rdev) vs. minor(inode->i_rdev) Brendan Burns
2002-01-09 19:55 ` Nikita Gergel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox