mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix kdev_t in st.c (2.5.2-pre7)
@ 2002-01-04 17:34 Jonathan Corbet
  0 siblings, 0 replies; only message in thread
From: Jonathan Corbet @ 2002-01-04 17:34 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Since yesterday's patch, sr and sg appear to have been fixed, but the SCSI
tape driver still has kdev_t problems.  Having fat-fingered my way into a
disk disaster yesterday, I have a real interest in a working tape drive :)
Here's a rework of my st.c kdev_t patch for 2.5.2-pre7.

jon

Jonathan Corbet
Executive editor, LWN.net
corbet@lwn.net

diff -r -u 2.5.2-pre6/drivers/scsi/st.c linux-2.5.2-pre6-scsi/drivers/scsi/st.c
--- 2.5.2-pre6/drivers/scsi/st.c	Thu Jan  3 11:35:26 2002
+++ linux-2.5.2-pre6-scsi/drivers/scsi/st.c	Thu Jan  3 11:38:22 2002
@@ -133,8 +133,8 @@
 #define ST_TIMEOUT (900 * HZ)
 #define ST_LONG_TIMEOUT (14000 * HZ)
 
-#define TAPE_NR(x) (MINOR(x) & ~(128 | ST_MODE_MASK))
-#define TAPE_MODE(x) ((MINOR(x) & ST_MODE_MASK) >> ST_MODE_SHIFT)
+#define TAPE_NR(x) (minor(x) & ~(128 | ST_MODE_MASK))
+#define TAPE_MODE(x) ((minor(x) & ST_MODE_MASK) >> ST_MODE_SHIFT)
 
 /* Internal ioctl to set both density (uppermost 8 bits) and blocksize (lower
    24 bits) */
@@ -878,7 +878,7 @@
 	}
 	STp->in_use = 1;
 	write_unlock_irqrestore(&st_dev_arr_lock, flags);
-	STp->rew_at_close = STp->autorew_dev = (MINOR(inode->i_rdev) & 0x80) == 0;
+	STp->rew_at_close = STp->autorew_dev = (minor(inode->i_rdev) & 0x80) == 0;
 
 	if (STp->device->host->hostt->module)
 		__MOD_INC_USE_COUNT(STp->device->host->hostt->module);
@@ -3717,7 +3717,7 @@
 		tpnt->tape_type = MT_ISSCSI2;
 
         tpnt->inited = 0;
-	tpnt->devt = MKDEV(SCSI_TAPE_MAJOR, i);
+	tpnt->devt = mk_kdev(SCSI_TAPE_MAJOR, i);
 	tpnt->dirty = 0;
 	tpnt->in_use = 0;
 	tpnt->drv_buffer = 1;	/* Try buffering if no mode sense */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-04 17:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-04 17:34 [PATCH] Fix kdev_t in st.c (2.5.2-pre7) Jonathan Corbet

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

all inboxes | Powered by JetHome®