Commit 16d6f850 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] kdev_t search/replaces.

First batch of various kdev_t related changes that have accumulated on
linux-kernel, and some that got sent directly to me after you dropped them.

Some of these need additional fixes to make them work, Some of them
even to make them compile, but this is one step forward..

I have bio-related fixes for some of these also, I'll push those seperately.
parent 9c0c830c
...@@ -746,7 +746,7 @@ static void request_done(int uptodate) ...@@ -746,7 +746,7 @@ static void request_done(int uptodate)
/* Yep - a partial access */ /* Yep - a partial access */
/* and issue the remainder */ /* and issue the remainder */
issue_request(MINOR(CURRENT->rq_dev), PartFragRead_RestartBlock, PartFragRead_SectorsLeft, CURRENT); issue_request(minor(CURRENT->rq_dev), PartFragRead_RestartBlock, PartFragRead_SectorsLeft, CURRENT);
return; return;
} }
...@@ -929,7 +929,7 @@ static void mfm_request(void) ...@@ -929,7 +929,7 @@ static void mfm_request(void)
DBG("mfm_request: before arg extraction\n"); DBG("mfm_request: before arg extraction\n");
dev = MINOR(CURRENT->rq_dev); dev = minor(CURRENT->rq_dev);
block = CURRENT->sector; block = CURRENT->sector;
nsect = CURRENT->nr_sectors; nsect = CURRENT->nr_sectors;
#ifdef DEBUG #ifdef DEBUG
...@@ -1187,10 +1187,10 @@ static int mfm_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long a ...@@ -1187,10 +1187,10 @@ static int mfm_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long a
if (!inode || !(dev = inode->i_rdev)) if (!inode || !(dev = inode->i_rdev))
return -EINVAL; return -EINVAL;
major = MAJOR(dev); major = major(dev);
minor = MINOR(dev); minor = minor(dev);
device = DEVICE_NR(MINOR(inode->i_rdev)), err; device = DEVICE_NR(minor(inode->i_rdev)), err;
if (device >= mfm_drives) if (device >= mfm_drives)
return -EINVAL; return -EINVAL;
...@@ -1231,7 +1231,7 @@ static int mfm_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long a ...@@ -1231,7 +1231,7 @@ static int mfm_ioctl(struct inode *inode, struct file *file, u_int cmd, u_long a
static int mfm_open(struct inode *inode, struct file *file) static int mfm_open(struct inode *inode, struct file *file)
{ {
int dev = DEVICE_NR(MINOR(inode->i_rdev)); int dev = DEVICE_NR(minor(inode->i_rdev));
if (dev >= mfm_drives) if (dev >= mfm_drives)
return -ENODEV; return -ENODEV;
...@@ -1249,7 +1249,7 @@ static int mfm_open(struct inode *inode, struct file *file) ...@@ -1249,7 +1249,7 @@ static int mfm_open(struct inode *inode, struct file *file)
*/ */
static int mfm_release(struct inode *inode, struct file *file) static int mfm_release(struct inode *inode, struct file *file)
{ {
mfm_info[DEVICE_NR(MINOR(inode->i_rdev))].access_count--; mfm_info[DEVICE_NR(minor(inode->i_rdev))].access_count--;
return 0; return 0;
} }
...@@ -1270,7 +1270,7 @@ void mfm_setup(char *str, int *ints) ...@@ -1270,7 +1270,7 @@ void mfm_setup(char *str, int *ints)
void xd_set_geometry(kdev_t dev, unsigned char secsptrack, unsigned char heads, void xd_set_geometry(kdev_t dev, unsigned char secsptrack, unsigned char heads,
unsigned long discsize, unsigned int secsize) unsigned long discsize, unsigned int secsize)
{ {
int drive = MINOR(dev) >> 6; int drive = minor(dev) >> 6;
if (mfm_info[drive].cylinders == 1) { if (mfm_info[drive].cylinders == 1) {
mfm_info[drive].sectors = secsptrack; mfm_info[drive].sectors = secsptrack;
...@@ -1338,7 +1338,7 @@ static void mfm_geninit (void) ...@@ -1338,7 +1338,7 @@ static void mfm_geninit (void)
for (i = 0; i < mfm_drives; i++) { for (i = 0; i < mfm_drives; i++) {
mfm_geometry (i); mfm_geometry (i);
register_disk(&mfm_gendisk, MKDEV(MAJOR_NR,i<<6), 1<<6, register_disk(&mfm_gendisk, mk_kdev(MAJOR_NR,i<<6), 1<<6,
&mfm_fops, &mfm_fops,
mfm_info[i].cylinders * mfm_info[i].heads * mfm_info[i].cylinders * mfm_info[i].heads *
mfm_info[i].sectors / 2); mfm_info[i].sectors / 2);
...@@ -1448,7 +1448,7 @@ int mfm_init (void) ...@@ -1448,7 +1448,7 @@ int mfm_init (void)
*/ */
static int mfm_reread_partitions(kdev_t dev) static int mfm_reread_partitions(kdev_t dev)
{ {
unsigned int start, i, maxp, target = DEVICE_NR(MINOR(dev)); unsigned int start, i, maxp, target = DEVICE_NR(minor(dev));
unsigned long flags; unsigned long flags;
local_irq_save(flags); local_irq_save(flags);
...@@ -1464,7 +1464,7 @@ static int mfm_reread_partitions(kdev_t dev) ...@@ -1464,7 +1464,7 @@ static int mfm_reread_partitions(kdev_t dev)
for (i = maxp - 1; i >= 0; i--) { for (i = maxp - 1; i >= 0; i--) {
int minor = start + i; int minor = start + i;
invalidate_device (MKDEV(MAJOR_NR, minor), 1); invalidate_device (mk_kdev(MAJOR_NR, minor), 1);
mfm_gendisk.part[minor].start_sect = 0; mfm_gendisk.part[minor].start_sect = 0;
mfm_gendisk.part[minor].nr_sects = 0; mfm_gendisk.part[minor].nr_sects = 0;
} }
......
...@@ -2074,7 +2074,7 @@ extern int DAC960_KernelIOCTL(unsigned int Request, void *Argument); ...@@ -2074,7 +2074,7 @@ extern int DAC960_KernelIOCTL(unsigned int Request, void *Argument);
#define DAC960_KernelDevice(ControllerNumber, \ #define DAC960_KernelDevice(ControllerNumber, \
LogicalDriveNumber, \ LogicalDriveNumber, \
PartitionNumber) \ PartitionNumber) \
MKDEV(DAC960_MajorNumber(ControllerNumber), \ mk_kdev(DAC960_MajorNumber(ControllerNumber), \
DAC960_MinorNumber(LogicalDriveNumber, PartitionNumber)) DAC960_MinorNumber(LogicalDriveNumber, PartitionNumber))
......
...@@ -784,7 +784,7 @@ static void read_intr( void ) ...@@ -784,7 +784,7 @@ static void read_intr( void )
status = acsi_getstatus(); status = acsi_getstatus();
if (status != 0) { if (status != 0) {
int dev = DEVICE_NR(MINOR(CURRENT->rq_dev)); int dev = DEVICE_NR(minor(CURRENT->rq_dev));
printk( KERN_ERR "ad%c: ", dev+'a' ); printk( KERN_ERR "ad%c: ", dev+'a' );
if (!acsi_reqsense( acsi_buffer, acsi_info[dev].target, if (!acsi_reqsense( acsi_buffer, acsi_info[dev].target,
acsi_info[dev].lun)) acsi_info[dev].lun))
...@@ -815,7 +815,7 @@ static void write_intr(void) ...@@ -815,7 +815,7 @@ static void write_intr(void)
status = acsi_getstatus(); status = acsi_getstatus();
if (status != 0) { if (status != 0) {
int dev = DEVICE_NR(MINOR(CURRENT->rq_dev)); int dev = DEVICE_NR(minor(CURRENT->rq_dev));
printk( KERN_ERR "ad%c: ", dev+'a' ); printk( KERN_ERR "ad%c: ", dev+'a' );
if (!acsi_reqsense( acsi_buffer, acsi_info[dev].target, if (!acsi_reqsense( acsi_buffer, acsi_info[dev].target,
acsi_info[dev].lun)) acsi_info[dev].lun))
...@@ -993,7 +993,7 @@ static void redo_acsi_request( void ) ...@@ -993,7 +993,7 @@ static void redo_acsi_request( void )
panic(DEVICE_NAME ": block not locked"); panic(DEVICE_NAME ": block not locked");
} }
dev = MINOR(CURRENT->rq_dev); dev = minor(CURRENT->rq_dev);
block = CURRENT->sector; block = CURRENT->sector;
if (DEVICE_NR(dev) >= NDevices || if (DEVICE_NR(dev) >= NDevices ||
block+CURRENT->nr_sectors >= acsi_part[dev].nr_sects) { block+CURRENT->nr_sectors >= acsi_part[dev].nr_sects) {
...@@ -1111,7 +1111,7 @@ static int acsi_ioctl( struct inode *inode, struct file *file, ...@@ -1111,7 +1111,7 @@ static int acsi_ioctl( struct inode *inode, struct file *file,
if (!inode) if (!inode)
return -EINVAL; return -EINVAL;
dev = DEVICE_NR(MINOR(inode->i_rdev)); dev = DEVICE_NR(minor(inode->i_rdev));
if (dev >= NDevices) if (dev >= NDevices)
return -EINVAL; return -EINVAL;
switch (cmd) { switch (cmd) {
...@@ -1174,7 +1174,7 @@ static int acsi_open( struct inode * inode, struct file * filp ) ...@@ -1174,7 +1174,7 @@ static int acsi_open( struct inode * inode, struct file * filp )
int device; int device;
struct acsi_info_struct *aip; struct acsi_info_struct *aip;
device = DEVICE_NR(MINOR(inode->i_rdev)); device = DEVICE_NR(minor(inode->i_rdev));
if (device >= NDevices) if (device >= NDevices)
return -ENXIO; return -ENXIO;
aip = &acsi_info[device]; aip = &acsi_info[device];
...@@ -1212,7 +1212,7 @@ static int acsi_open( struct inode * inode, struct file * filp ) ...@@ -1212,7 +1212,7 @@ static int acsi_open( struct inode * inode, struct file * filp )
static int acsi_release( struct inode * inode, struct file * file ) static int acsi_release( struct inode * inode, struct file * file )
{ {
int device = DEVICE_NR(MINOR(inode->i_rdev)); int device = DEVICE_NR(minor(inode->i_rdev));
if (--access_count[device] == 0 && acsi_info[device].removable) if (--access_count[device] == 0 && acsi_info[device].removable)
acsi_prevent_removal(device, 0); acsi_prevent_removal(device, 0);
return( 0 ); return( 0 );
...@@ -1240,7 +1240,7 @@ static void acsi_prevent_removal(int device, int flag) ...@@ -1240,7 +1240,7 @@ static void acsi_prevent_removal(int device, int flag)
static int acsi_media_change (dev_t dev) static int acsi_media_change (dev_t dev)
{ {
int device = DEVICE_NR(MINOR(dev)); int device = DEVICE_NR(minor(dev));
struct acsi_info_struct *aip; struct acsi_info_struct *aip;
aip = &acsi_info[device]; aip = &acsi_info[device];
...@@ -1742,7 +1742,7 @@ static void acsi_geninit(void) ...@@ -1742,7 +1742,7 @@ static void acsi_geninit(void)
acsi_blocksizes[i] = 1024; acsi_blocksizes[i] = 1024;
blksize_size[MAJOR_NR] = acsi_blocksizes; blksize_size[MAJOR_NR] = acsi_blocksizes;
for( i = 0; i < NDevices; ++i ) for( i = 0; i < NDevices; ++i )
register_disk(&acsi_gendisk, MKDEV(MAJOR_NR,i<<4), register_disk(&acsi_gendisk, mk_kdev(MAJOR_NR,i<<4),
(acsi_info[i].type==HARDDISK)?1<<4:1, (acsi_info[i].type==HARDDISK)?1<<4:1,
&acsi_fops, &acsi_fops,
acsi_info[i].size); acsi_info[i].size);
...@@ -1853,7 +1853,7 @@ static int revalidate_acsidisk( int dev, int maxusage ) ...@@ -1853,7 +1853,7 @@ static int revalidate_acsidisk( int dev, int maxusage )
int res; int res;
struct acsi_info_struct *aip; struct acsi_info_struct *aip;
device = DEVICE_NR(MINOR(dev)); device = DEVICE_NR(minor(dev));
aip = &acsi_info[device]; aip = &acsi_info[device];
gdev = &GENDISK_STRUCT; gdev = &GENDISK_STRUCT;
......
...@@ -659,7 +659,7 @@ static int do_format(kdev_t device, struct atari_format_descr *desc) ...@@ -659,7 +659,7 @@ static int do_format(kdev_t device, struct atari_format_descr *desc)
unsigned char *p; unsigned char *p;
int sect, nsect; int sect, nsect;
unsigned long flags; unsigned long flags;
int type, drive = MINOR(device) & 3; int type, drive = minor(device) & 3;
DPRINT(("do_format( dr=%d tr=%d he=%d offs=%d )\n", DPRINT(("do_format( dr=%d tr=%d he=%d offs=%d )\n",
drive, desc->track, desc->head, desc->sect_offset )); drive, desc->track, desc->head, desc->sect_offset ));
...@@ -672,7 +672,7 @@ static int do_format(kdev_t device, struct atari_format_descr *desc) ...@@ -672,7 +672,7 @@ static int do_format(kdev_t device, struct atari_format_descr *desc)
atari_turnon_irq( IRQ_MFP_FDC ); /* should be already, just to be sure */ atari_turnon_irq( IRQ_MFP_FDC ); /* should be already, just to be sure */
restore_flags(flags); restore_flags(flags);
type = MINOR(device) >> 2; type = minor(device) >> 2;
if (type) { if (type) {
if (--type >= NUM_DISK_MINORS || if (--type >= NUM_DISK_MINORS ||
minor2disktype[type].drive_types > DriveType) { minor2disktype[type].drive_types > DriveType) {
...@@ -1367,9 +1367,9 @@ static void floppy_off( unsigned int nr) {} ...@@ -1367,9 +1367,9 @@ static void floppy_off( unsigned int nr) {}
static int check_floppy_change (kdev_t dev) static int check_floppy_change (kdev_t dev)
{ {
unsigned int drive = MINOR(dev) & 0x03; unsigned int drive = minor(dev) & 0x03;
if (MAJOR(dev) != MAJOR_NR) { if (major(dev) != MAJOR_NR) {
printk(KERN_ERR "floppy_changed: not a floppy\n"); printk(KERN_ERR "floppy_changed: not a floppy\n");
return 0; return 0;
} }
...@@ -1394,7 +1394,7 @@ static int check_floppy_change (kdev_t dev) ...@@ -1394,7 +1394,7 @@ static int check_floppy_change (kdev_t dev)
static int floppy_revalidate (kdev_t dev) static int floppy_revalidate (kdev_t dev)
{ {
int drive = MINOR(dev) & 3; int drive = minor(dev) & 3;
if (test_bit(drive, &changed_floppies) || if (test_bit(drive, &changed_floppies) ||
test_bit(drive, &fake_change) || test_bit(drive, &fake_change) ||
...@@ -1466,13 +1466,13 @@ static void redo_fd_request(void) ...@@ -1466,13 +1466,13 @@ static void redo_fd_request(void)
if (QUEUE_EMPTY) if (QUEUE_EMPTY)
goto the_end; goto the_end;
if (MAJOR(CURRENT->rq_dev) != MAJOR_NR) if (major(CURRENT->rq_dev) != MAJOR_NR)
panic(DEVICE_NAME ": request list destroyed"); panic(DEVICE_NAME ": request list destroyed");
if (CURRENT->bh && !buffer_locked(CURRENT->bh)) if (CURRENT->bh && !buffer_locked(CURRENT->bh))
panic(DEVICE_NAME ": block not locked"); panic(DEVICE_NAME ": block not locked");
device = MINOR(CURRENT_DEVICE); device = minor(CURRENT_DEVICE);
drive = device & 3; drive = device & 3;
type = device >> 2; type = device >> 2;
...@@ -1553,7 +1553,7 @@ static int invalidate_drive(kdev_t rdev) ...@@ -1553,7 +1553,7 @@ static int invalidate_drive(kdev_t rdev)
{ {
/* invalidate the buffer track to force a reread */ /* invalidate the buffer track to force a reread */
BufferDrive = -1; BufferDrive = -1;
set_bit(MINOR(rdev) & 3, &fake_change); set_bit(minor(rdev) & 3, &fake_change);
check_disk_change(rdev); check_disk_change(rdev);
return 0; return 0;
} }
...@@ -1576,7 +1576,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, ...@@ -1576,7 +1576,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
case BLKFLSBUF: case BLKFLSBUF:
return blk_ioctl(device, cmd, param); return blk_ioctl(device, cmd, param);
} }
drive = MINOR (device); drive = minor (device);
type = drive >> 2; type = drive >> 2;
drive &= 3; drive &= 3;
switch (cmd) { switch (cmd) {
...@@ -1896,15 +1896,15 @@ static int floppy_open( struct inode *inode, struct file *filp ) ...@@ -1896,15 +1896,15 @@ static int floppy_open( struct inode *inode, struct file *filp )
return -EIO; return -EIO;
} }
drive = MINOR(inode->i_rdev) & 3; drive = minor(inode->i_rdev) & 3;
type = MINOR(inode->i_rdev) >> 2; type = minor(inode->i_rdev) >> 2;
DPRINT(("fd_open: type=%d\n",type)); DPRINT(("fd_open: type=%d\n",type));
if (drive >= FD_MAX_UNITS || type > NUM_DISK_MINORS) if (drive >= FD_MAX_UNITS || type > NUM_DISK_MINORS)
return -ENXIO; return -ENXIO;
old_dev = fd_device[drive]; old_dev = fd_device[drive];
if (fd_ref[drive] && old_dev != MINOR(inode->i_rdev)) if (fd_ref[drive] && old_dev != minor(inode->i_rdev))
return -EBUSY; return -EBUSY;
if (fd_ref[drive] == -1 || (fd_ref[drive] && filp->f_flags & O_EXCL)) if (fd_ref[drive] == -1 || (fd_ref[drive] && filp->f_flags & O_EXCL))
...@@ -1915,10 +1915,10 @@ static int floppy_open( struct inode *inode, struct file *filp ) ...@@ -1915,10 +1915,10 @@ static int floppy_open( struct inode *inode, struct file *filp )
else else
fd_ref[drive]++; fd_ref[drive]++;
fd_device[drive] = MINOR(inode->i_rdev); fd_device[drive] = minor(inode->i_rdev);
if (old_dev && old_dev != MINOR(inode->i_rdev)) if (old_dev && old_dev != minor(inode->i_rdev))
invalidate_buffers(MKDEV(FLOPPY_MAJOR, old_dev)); invalidate_buffers(mk_kdev(FLOPPY_MAJOR, old_dev));
if (filp->f_flags & O_NDELAY) if (filp->f_flags & O_NDELAY)
return 0; return 0;
...@@ -1939,7 +1939,7 @@ static int floppy_open( struct inode *inode, struct file *filp ) ...@@ -1939,7 +1939,7 @@ static int floppy_open( struct inode *inode, struct file *filp )
static int floppy_release( struct inode * inode, struct file * filp ) static int floppy_release( struct inode * inode, struct file * filp )
{ {
int drive = MINOR(inode->i_rdev) & 3; int drive = minor(inode->i_rdev) & 3;
if (fd_ref[drive] < 0) if (fd_ref[drive] < 0)
fd_ref[drive] = 0; fd_ref[drive] = 0;
......
...@@ -70,7 +70,7 @@ static unsigned int ataraiduse; ...@@ -70,7 +70,7 @@ static unsigned int ataraiduse;
static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{ {
int minor; int minor;
minor = MINOR(inode->i_rdev)>>SHIFT; minor = minor(inode->i_rdev)>>SHIFT;
if ((ataraid_ops[minor])&&(ataraid_ops[minor]->ioctl)) if ((ataraid_ops[minor])&&(ataraid_ops[minor]->ioctl))
return (ataraid_ops[minor]->ioctl)(inode,file,cmd,arg); return (ataraid_ops[minor]->ioctl)(inode,file,cmd,arg);
...@@ -80,7 +80,7 @@ static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -80,7 +80,7 @@ static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cm
static int ataraid_open(struct inode * inode, struct file * filp) static int ataraid_open(struct inode * inode, struct file * filp)
{ {
int minor; int minor;
minor = MINOR(inode->i_rdev)>>SHIFT; minor = minor(inode->i_rdev)>>SHIFT;
if ((ataraid_ops[minor])&&(ataraid_ops[minor]->open)) if ((ataraid_ops[minor])&&(ataraid_ops[minor]->open))
return (ataraid_ops[minor]->open)(inode,filp); return (ataraid_ops[minor]->open)(inode,filp);
...@@ -91,7 +91,7 @@ static int ataraid_open(struct inode * inode, struct file * filp) ...@@ -91,7 +91,7 @@ static int ataraid_open(struct inode * inode, struct file * filp)
static int ataraid_release(struct inode * inode, struct file * filp) static int ataraid_release(struct inode * inode, struct file * filp)
{ {
int minor; int minor;
minor = MINOR(inode->i_rdev)>>SHIFT; minor = minor(inode->i_rdev)>>SHIFT;
if ((ataraid_ops[minor])&&(ataraid_ops[minor]->release)) if ((ataraid_ops[minor])&&(ataraid_ops[minor]->release))
return (ataraid_ops[minor]->release)(inode,filp); return (ataraid_ops[minor]->release)(inode,filp);
...@@ -102,7 +102,7 @@ static int ataraid_make_request (request_queue_t *q, int rw, struct buffer_head ...@@ -102,7 +102,7 @@ static int ataraid_make_request (request_queue_t *q, int rw, struct buffer_head
{ {
int minor; int minor;
int retval; int retval;
minor = MINOR(bh->b_rdev)>>SHIFT; minor = minor(bh->b_rdev)>>SHIFT;
if ((ataraid_ops[minor])&&(ataraid_ops[minor]->make_request)) { if ((ataraid_ops[minor])&&(ataraid_ops[minor]->make_request)) {
...@@ -229,7 +229,7 @@ void ataraid_release_device(int device) ...@@ -229,7 +229,7 @@ void ataraid_release_device(int device)
void ataraid_register_disk(int device,long size) void ataraid_register_disk(int device,long size)
{ {
register_disk(&ataraid_gendisk, MKDEV(ATAMAJOR,16*device),16, register_disk(&ataraid_gendisk, mk_kdev(ATAMAJOR,16*device),16,
&ataraid_fops,size); &ataraid_fops,size);
} }
......
...@@ -558,7 +558,7 @@ static void hd_request(void) ...@@ -558,7 +558,7 @@ static void hd_request(void)
reset_hd(); reset_hd();
return; return;
} }
dev = MINOR(CURRENT->rq_dev); dev = minor(CURRENT->rq_dev);
block = CURRENT->sector; block = CURRENT->sector;
nsect = CURRENT->nr_sectors; nsect = CURRENT->nr_sectors;
if (dev >= (NR_HD<<6) || (dev & 0x3f) || if (dev >= (NR_HD<<6) || (dev & 0x3f) ||
...@@ -568,7 +568,7 @@ static void hd_request(void) ...@@ -568,7 +568,7 @@ static void hd_request(void)
kdevname(CURRENT->rq_dev)); kdevname(CURRENT->rq_dev));
else else
printk("hd%c: bad access: block=%d, count=%d\n", printk("hd%c: bad access: block=%d, count=%d\n",
(MINOR(CURRENT->rq_dev)>>6)+'a', block, nsect); (minor(CURRENT->rq_dev)>>6)+'a', block, nsect);
end_request(0); end_request(0);
goto repeat; goto repeat;
} }
...@@ -626,7 +626,7 @@ static int hd_ioctl(struct inode * inode, struct file * file, ...@@ -626,7 +626,7 @@ static int hd_ioctl(struct inode * inode, struct file * file,
struct hd_geometry *loc = (struct hd_geometry *) arg; struct hd_geometry *loc = (struct hd_geometry *) arg;
int dev; int dev;
if ((!inode) || !(inode->i_rdev)) if ((!inode) || kdev_none(inode->i_rdev))
return -EINVAL; return -EINVAL;
dev = DEVICE_NR(inode->i_rdev); dev = DEVICE_NR(inode->i_rdev);
if (dev >= NR_HD) if (dev >= NR_HD)
...@@ -822,7 +822,7 @@ static void __init hd_geninit(void) ...@@ -822,7 +822,7 @@ static void __init hd_geninit(void)
hd_gendisk.nr_real = NR_HD; hd_gendisk.nr_real = NR_HD;
for(drive=0; drive < NR_HD; drive++) for(drive=0; drive < NR_HD; drive++)
register_disk(&hd_gendisk, MKDEV(MAJOR_NR,drive<<6), 1<<6, register_disk(&hd_gendisk, mk_kdev(MAJOR_NR,drive<<6), 1<<6,
&hd_fops, hd_info[drive].head * hd_info[drive].sect * &hd_fops, hd_info[drive].head * hd_info[drive].sect *
hd_info[drive].cyl); hd_info[drive].cyl);
} }
......
...@@ -75,16 +75,16 @@ static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -75,16 +75,16 @@ static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cm
unsigned char val; unsigned char val;
unsigned long sectors; unsigned long sectors;
if (!inode || !inode->i_rdev) if (!inode || kdev_none(inode->i_rdev))
return -EINVAL; return -EINVAL;
minor = MINOR(inode->i_rdev)>>SHIFT; minor = minor(inode->i_rdev)>>SHIFT;
switch (cmd) { switch (cmd) {
case BLKGETSIZE: /* Return device size */ case BLKGETSIZE: /* Return device size */
if (!arg) return -EINVAL; if (!arg) return -EINVAL;
sectors = ataraid_gendisk.part[MINOR(inode->i_rdev)].nr_sects; sectors = ataraid_gendisk.part[minor(inode->i_rdev)].nr_sects;
if (MINOR(inode->i_rdev)&15) if (minor(inode->i_rdev)&15)
return put_user(sectors, (unsigned long *) arg); return put_user(sectors, (unsigned long *) arg);
return put_user(raid[minor].sectors , (unsigned long *) arg); return put_user(raid[minor].sectors , (unsigned long *) arg);
break; break;
...@@ -102,7 +102,7 @@ static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -102,7 +102,7 @@ static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cm
if (put_user(val, (byte *) &loc->sectors)) return -EFAULT; if (put_user(val, (byte *) &loc->sectors)) return -EFAULT;
bios_cyl = raid[minor].sectors/63/255; bios_cyl = raid[minor].sectors/63/255;
if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT; if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT;
if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, if (put_user((unsigned)ataraid_gendisk.part[minor(inode->i_rdev)].start_sect,
(unsigned long *) &loc->start)) return -EFAULT; (unsigned long *) &loc->start)) return -EFAULT;
return 0; return 0;
} }
...@@ -118,7 +118,7 @@ static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -118,7 +118,7 @@ static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cm
if (put_user(val, (byte *) &loc->sectors)) return -EFAULT; if (put_user(val, (byte *) &loc->sectors)) return -EFAULT;
bios_cyl = raid[minor].sectors/63/255; bios_cyl = raid[minor].sectors/63/255;
if (put_user(bios_cyl, (unsigned int *) &loc->cylinders)) return -EFAULT; if (put_user(bios_cyl, (unsigned int *) &loc->cylinders)) return -EFAULT;
if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, if (put_user((unsigned)ataraid_gendisk.part[minor(inode->i_rdev)].start_sect,
(unsigned long *) &loc->start)) return -EFAULT; (unsigned long *) &loc->start)) return -EFAULT;
return 0; return 0;
} }
...@@ -167,7 +167,7 @@ static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head ...@@ -167,7 +167,7 @@ static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head
/* Partitions need adding of the start sector of the partition to the requested sector */ /* Partitions need adding of the start sector of the partition to the requested sector */
rsect += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; rsect += ataraid_gendisk.part[minor(bh->b_rdev)].start_sect;
/* Woops we need to split the request to avoid crossing a stride barrier */ /* Woops we need to split the request to avoid crossing a stride barrier */
if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) { if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) {
...@@ -248,7 +248,7 @@ static unsigned long maxsectors (int major,int minor) ...@@ -248,7 +248,7 @@ static unsigned long maxsectors (int major,int minor)
kdev_t dev; kdev_t dev;
ide_drive_t *ideinfo; ide_drive_t *ideinfo;
dev = MKDEV(major,minor); dev = mk_kdev(major,minor);
ideinfo = get_info_ptr (dev); ideinfo = get_info_ptr (dev);
if (ideinfo==NULL) if (ideinfo==NULL)
return 0; return 0;
...@@ -268,7 +268,7 @@ static struct highpoint_raid_conf __initdata prom; ...@@ -268,7 +268,7 @@ static struct highpoint_raid_conf __initdata prom;
static void __init probedisk(int major, int minor,int device) static void __init probedisk(int major, int minor,int device)
{ {
int i; int i;
struct block_device *bdev = bdget(MKDEV(major,minor)); struct block_device *bdev = bdget(mk_kdev(major,minor));
struct gendisk *gd; struct gendisk *gd;
if (!bdev) if (!bdev)
...@@ -301,14 +301,14 @@ static void __init probedisk(int major, int minor,int device) ...@@ -301,14 +301,14 @@ static void __init probedisk(int major, int minor,int device)
/* now blank the /proc/partitions table for the wrong partition table, /* now blank the /proc/partitions table for the wrong partition table,
so that scripts don't accidentally mount it and crash the kernel */ so that scripts don't accidentally mount it and crash the kernel */
/* XXX: the 0 is an utter hack --hch */ /* XXX: the 0 is an utter hack --hch */
gd=get_gendisk(MKDEV(major, 0)); gd=get_gendisk(mk_kdev(major, 0));
if (gd!=NULL) { if (gd!=NULL) {
int j; int j;
for (j=1+(minor<<gd->minor_shift);j<((minor+1)<<gd->minor_shift);j++) for (j=1+(minor<<gd->minor_shift);j<((minor+1)<<gd->minor_shift);j++)
gd->part[j].nr_sects=0; gd->part[j].nr_sects=0;
} }
raid[device].disk[i].device = MKDEV(major,minor); raid[device].disk[i].device = mk_kdev(major,minor);
raid[device].disk[i].sectors = maxsectors(major,minor); raid[device].disk[i].sectors = maxsectors(major,minor);
raid[device].stride = (1<<prom.raid0_shift); raid[device].stride = (1<<prom.raid0_shift);
raid[device].disks = prom.raid_disks; raid[device].disks = prom.raid_disks;
......
...@@ -102,17 +102,17 @@ static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -102,17 +102,17 @@ static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cm
unsigned int minor; unsigned int minor;
unsigned long sectors; unsigned long sectors;
if (!inode || !inode->i_rdev) if (!inode || kdev_none(inode->i_rdev))
return -EINVAL; return -EINVAL;
minor = MINOR(inode->i_rdev)>>SHIFT; minor = minor(inode->i_rdev)>>SHIFT;
switch (cmd) { switch (cmd) {
case BLKGETSIZE: /* Return device size */ case BLKGETSIZE: /* Return device size */
if (!arg) return -EINVAL; if (!arg) return -EINVAL;
sectors = ataraid_gendisk.part[MINOR(inode->i_rdev)].nr_sects; sectors = ataraid_gendisk.part[minor(inode->i_rdev)].nr_sects;
if (MINOR(inode->i_rdev)&15) if (minor(inode->i_rdev)&15)
return put_user(sectors, (unsigned long *) arg); return put_user(sectors, (unsigned long *) arg);
return put_user(raid[minor].sectors , (unsigned long *) arg); return put_user(raid[minor].sectors , (unsigned long *) arg);
break; break;
...@@ -127,7 +127,7 @@ static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -127,7 +127,7 @@ static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cm
if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT; if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT;
if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT; if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT;
if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT; if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT;
if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, if (put_user((unsigned)ataraid_gendisk.part[minor(inode->i_rdev)].start_sect,
(unsigned long *) &loc->start)) return -EFAULT; (unsigned long *) &loc->start)) return -EFAULT;
return 0; return 0;
} }
...@@ -139,7 +139,7 @@ static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cm ...@@ -139,7 +139,7 @@ static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cm
if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT; if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT;
if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT; if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT;
if (put_user(raid[minor].geom.cylinders, (unsigned int *) &loc->cylinders)) return -EFAULT; if (put_user(raid[minor].geom.cylinders, (unsigned int *) &loc->cylinders)) return -EFAULT;
if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, if (put_user((unsigned)ataraid_gendisk.part[minor(inode->i_rdev)].start_sect,
(unsigned long *) &loc->start)) return -EFAULT; (unsigned long *) &loc->start)) return -EFAULT;
return 0; return 0;
} }
...@@ -463,7 +463,7 @@ static void __init probedisk(int devindex,int device, int raidlevel) ...@@ -463,7 +463,7 @@ static void __init probedisk(int devindex,int device, int raidlevel)
major = devlist[devindex].major; major = devlist[devindex].major;
minor = devlist[devindex].minor; minor = devlist[devindex].minor;
bdev = bdget(MKDEV(major,minor)); bdev = bdget(mk_kdev(major,minor));
if (!bdev) if (!bdev)
return; return;
...@@ -491,7 +491,7 @@ static void __init probedisk(int devindex,int device, int raidlevel) ...@@ -491,7 +491,7 @@ static void __init probedisk(int devindex,int device, int raidlevel)
(prom.raid.disk[i].device == prom.raid.device) ) { (prom.raid.disk[i].device == prom.raid.device) ) {
raid[device].disk[i].bdev = bdev; raid[device].disk[i].bdev = bdev;
raid[device].disk[i].device = MKDEV(major,minor); raid[device].disk[i].device = mk_kdev(major,minor);
raid[device].disk[i].sectors = prom.raid.disk_secs; raid[device].disk[i].sectors = prom.raid.disk_secs;
raid[device].stride = (1<<prom.raid.raid0_shift); raid[device].stride = (1<<prom.raid.raid0_shift);
raid[device].disks = prom.raid.total_disks; raid[device].disks = prom.raid.total_disks;
...@@ -551,7 +551,7 @@ static __init int pdcraid_init_one(int device,int raidlevel) ...@@ -551,7 +551,7 @@ static __init int pdcraid_init_one(int device,int raidlevel)
for (i=0;i<8;i++) { for (i=0;i<8;i++) {
if (raid[device].disk[i].device!=0) { if (raid[device].disk[i].device!=0) {
printk(KERN_INFO "Drive %i is %li Mb (%i / %i) \n", printk(KERN_INFO "Drive %i is %li Mb (%i / %i) \n",
i,raid[device].disk[i].sectors/2048,MAJOR(raid[device].disk[i].device),MINOR(raid[device].disk[i].device)); i,raid[device].disk[i].sectors/2048,major(raid[device].disk[i].device),minor(raid[device].disk[i].device));
count++; count++;
} }
} }
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
#define I2O_BSA_DSC_VOLUME_CHANGED 0x000D #define I2O_BSA_DSC_VOLUME_CHANGED 0x000D
#define I2O_BSA_DSC_TIMEOUT 0x000E #define I2O_BSA_DSC_TIMEOUT 0x000E
#define I2O_UNIT(dev) (i2ob_dev[MINOR((dev)) & 0xf0]) #define I2O_UNIT(dev) (i2ob_dev[minor((dev)) & 0xf0])
#define I2O_LOCK(unit) (i2ob_dev[(unit)].req_queue->queue_lock) #define I2O_LOCK(unit) (i2ob_dev[(unit)].req_queue->queue_lock)
/* /*
...@@ -760,7 +760,7 @@ static int i2ob_evt(void *dummy) ...@@ -760,7 +760,7 @@ static int i2ob_evt(void *dummy)
{ {
u64 size; u64 size;
if(do_i2ob_revalidate(MKDEV(MAJOR_NR, unit),0) != -EBUSY) if(do_i2ob_revalidate(mk_kdev(MAJOR_NR, unit),0) != -EBUSY)
continue; continue;
if(i2ob_query_device(&i2ob_dev[unit], 0x0004, 0, &size, 8) !=0 ) if(i2ob_query_device(&i2ob_dev[unit], 0x0004, 0, &size, 8) !=0 )
...@@ -869,7 +869,7 @@ static int i2ob_backlog_request(struct i2o_controller *c, struct i2ob_device *de ...@@ -869,7 +869,7 @@ static int i2ob_backlog_request(struct i2o_controller *c, struct i2ob_device *de
if(i2ob_backlog[c->unit] == NULL) if(i2ob_backlog[c->unit] == NULL)
i2ob_backlog_tail[c->unit] = NULL; i2ob_backlog_tail[c->unit] = NULL;
unit = MINOR(ireq->req->rq_dev); unit = minor(ireq->req->rq_dev);
i2ob_send(m, dev, ireq, i2ob[unit].start_sect, unit); i2ob_send(m, dev, ireq, i2ob[unit].start_sect, unit);
} }
if(i2ob_backlog[c->unit]) if(i2ob_backlog[c->unit])
...@@ -905,7 +905,7 @@ static void i2ob_request(request_queue_t *q) ...@@ -905,7 +905,7 @@ static void i2ob_request(request_queue_t *q)
if(req->rq_status == RQ_INACTIVE) if(req->rq_status == RQ_INACTIVE)
return; return;
unit = MINOR(req->rq_dev); unit = minor(req->rq_dev);
dev = &i2ob_dev[(unit&0xF0)]; dev = &i2ob_dev[(unit&0xF0)];
/* /*
...@@ -1038,7 +1038,7 @@ static void i2o_block_biosparam( ...@@ -1038,7 +1038,7 @@ static void i2o_block_biosparam(
static int do_i2ob_revalidate(kdev_t dev, int maxu) static int do_i2ob_revalidate(kdev_t dev, int maxu)
{ {
int minor=MINOR(dev); int minor=minor(dev);
int i; int i;
minor&=0xF0; minor&=0xF0;
...@@ -1053,7 +1053,7 @@ static int do_i2ob_revalidate(kdev_t dev, int maxu) ...@@ -1053,7 +1053,7 @@ static int do_i2ob_revalidate(kdev_t dev, int maxu)
for( i = 15; i>=0 ; i--) for( i = 15; i>=0 ; i--)
{ {
int m = minor+i; int m = minor+i;
invalidate_device(MKDEV(MAJOR_NR, m), 1); invalidate_device(mk_kdev(MAJOR_NR, m), 1);
i2ob_gendisk.part[m].start_sect = 0; i2ob_gendisk.part[m].start_sect = 0;
i2ob_gendisk.part[m].nr_sects = 0; i2ob_gendisk.part[m].nr_sects = 0;
} }
...@@ -1079,14 +1079,14 @@ static int i2ob_ioctl(struct inode *inode, struct file *file, ...@@ -1079,14 +1079,14 @@ static int i2ob_ioctl(struct inode *inode, struct file *file,
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
if (!inode || !inode->i_rdev) if (!inode || kdev_none(inode->i_rdev))
return -EINVAL; return -EINVAL;
switch (cmd) { switch (cmd) {
case HDIO_GETGEO: case HDIO_GETGEO:
{ {
struct hd_geometry g; struct hd_geometry g;
int u = MINOR(inode->i_rdev) & 0xF0; int u = minor(inode->i_rdev) & 0xF0;
i2o_block_biosparam(i2ob_sizes[u]<<1, i2o_block_biosparam(i2ob_sizes[u]<<1,
&g.cylinders, &g.heads, &g.sectors); &g.cylinders, &g.heads, &g.sectors);
g.start = get_start_sect(inode->i_rdev); g.start = get_start_sect(inode->i_rdev);
...@@ -1121,7 +1121,7 @@ static int i2ob_release(struct inode *inode, struct file *file) ...@@ -1121,7 +1121,7 @@ static int i2ob_release(struct inode *inode, struct file *file)
struct i2ob_device *dev; struct i2ob_device *dev;
int minor; int minor;
minor = MINOR(inode->i_rdev); minor = minor(inode->i_rdev);
if (minor >= (MAX_I2OB<<4)) if (minor >= (MAX_I2OB<<4))
return -ENODEV; return -ENODEV;
dev = &i2ob_dev[(minor&0xF0)]; dev = &i2ob_dev[(minor&0xF0)];
...@@ -1193,7 +1193,7 @@ static int i2ob_open(struct inode *inode, struct file *file) ...@@ -1193,7 +1193,7 @@ static int i2ob_open(struct inode *inode, struct file *file)
if (!inode) if (!inode)
return -EINVAL; return -EINVAL;
minor = MINOR(inode->i_rdev); minor = minor(inode->i_rdev);
if (minor >= MAX_I2OB<<4) if (minor >= MAX_I2OB<<4)
return -ENODEV; return -ENODEV;
dev=&i2ob_dev[(minor&0xF0)]; dev=&i2ob_dev[(minor&0xF0)];
...@@ -1384,7 +1384,7 @@ static int i2ob_install_device(struct i2o_controller *c, struct i2o_device *d, i ...@@ -1384,7 +1384,7 @@ static int i2ob_install_device(struct i2o_controller *c, struct i2o_device *d, i
*/ */
dev->req_queue = &i2ob_queues[c->unit]->req_queue; dev->req_queue = &i2ob_queues[c->unit]->req_queue;
grok_partitions(MKDEV(MAJOR_NR, unit), (long)(size>>9)); grok_partitions(mk_kdev(MAJOR_NR, unit), (long)(size>>9));
/* /*
* Register for the events we're interested in and that the * Register for the events we're interested in and that the
...@@ -1704,7 +1704,7 @@ void i2ob_del_device(struct i2o_controller *c, struct i2o_device *d) ...@@ -1704,7 +1704,7 @@ void i2ob_del_device(struct i2o_controller *c, struct i2o_device *d)
*/ */
static int i2ob_media_change(kdev_t dev) static int i2ob_media_change(kdev_t dev)
{ {
int i=MINOR(dev); int i=minor(dev);
i>>=4; i>>=4;
if(i2ob_media_change_flag[i]) if(i2ob_media_change_flag[i])
{ {
...@@ -1883,7 +1883,7 @@ int i2o_block_init(void) ...@@ -1883,7 +1883,7 @@ int i2o_block_init(void)
* Finally see what is actually plugged in to our controllers * Finally see what is actually plugged in to our controllers
*/ */
for (i = 0; i < MAX_I2OB; i++) for (i = 0; i < MAX_I2OB; i++)
register_disk(&i2ob_gendisk, MKDEV(MAJOR_NR,i<<4), 1<<4, register_disk(&i2ob_gendisk, mk_kdev(MAJOR_NR,i<<4), 1<<4,
&i2ob_fops, 0); &i2ob_fops, 0);
i2ob_probe(); i2ob_probe();
......
...@@ -156,7 +156,7 @@ static void NFTL_setup(struct mtd_info *mtd) ...@@ -156,7 +156,7 @@ static void NFTL_setup(struct mtd_info *mtd)
#if LINUX_VERSION_CODE < 0x20328 #if LINUX_VERSION_CODE < 0x20328
resetup_one_dev(&nftl_gendisk, firstfree); resetup_one_dev(&nftl_gendisk, firstfree);
#else #else
grok_partitions(MKDEV(MAJOR_NR,firstfree<<NFTL_PARTN_BITS), grok_partitions(mk_kdev(MAJOR_NR,firstfree<<NFTL_PARTN_BITS),
nftl->nr_sects); nftl->nr_sects);
#endif #endif
} }
...@@ -779,7 +779,7 @@ static int nftl_ioctl(struct inode * inode, struct file * file, unsigned int cmd ...@@ -779,7 +779,7 @@ static int nftl_ioctl(struct inode * inode, struct file * file, unsigned int cmd
struct NFTLrecord *nftl; struct NFTLrecord *nftl;
int res; int res;
nftl = NFTLs[MINOR(inode->i_rdev) >> NFTL_PARTN_BITS]; nftl = NFTLs[minor(inode->i_rdev) >> NFTL_PARTN_BITS];
if (!nftl) return -EINVAL; if (!nftl) return -EINVAL;
...@@ -853,7 +853,7 @@ void nftl_request(RQFUNC_ARG) ...@@ -853,7 +853,7 @@ void nftl_request(RQFUNC_ARG)
(req->cmd == READ) ? "Read " : "Write", (req->cmd == READ) ? "Read " : "Write",
req->sector, req->current_nr_sectors); req->sector, req->current_nr_sectors);
dev = MINOR(req->rq_dev); dev = minor(req->rq_dev);
block = req->sector; block = req->sector;
nsect = req->current_nr_sectors; nsect = req->current_nr_sectors;
buffer = req->buffer; buffer = req->buffer;
...@@ -875,7 +875,7 @@ void nftl_request(RQFUNC_ARG) ...@@ -875,7 +875,7 @@ void nftl_request(RQFUNC_ARG)
if (block + nsect > part_table[dev].nr_sects) { if (block + nsect > part_table[dev].nr_sects) {
/* access past the end of device */ /* access past the end of device */
printk("nftl%c%d: bad access: block = %d, count = %d\n", printk("nftl%c%d: bad access: block = %d, count = %d\n",
(MINOR(req->rq_dev)>>6)+'a', dev & 0xf, block, nsect); (minor(req->rq_dev)>>6)+'a', dev & 0xf, block, nsect);
up(&nftl->mutex); up(&nftl->mutex);
res = 0; /* fail */ res = 0; /* fail */
goto repeat; goto repeat;
...@@ -933,7 +933,7 @@ void nftl_request(RQFUNC_ARG) ...@@ -933,7 +933,7 @@ void nftl_request(RQFUNC_ARG)
static int nftl_open(struct inode *ip, struct file *fp) static int nftl_open(struct inode *ip, struct file *fp)
{ {
int nftlnum = MINOR(ip->i_rdev) >> NFTL_PARTN_BITS; int nftlnum = minor(ip->i_rdev) >> NFTL_PARTN_BITS;
struct NFTLrecord *thisNFTL; struct NFTLrecord *thisNFTL;
thisNFTL = NFTLs[nftlnum]; thisNFTL = NFTLs[nftlnum];
...@@ -947,7 +947,7 @@ static int nftl_open(struct inode *ip, struct file *fp) ...@@ -947,7 +947,7 @@ static int nftl_open(struct inode *ip, struct file *fp)
#endif #endif
if (!thisNFTL) { if (!thisNFTL) {
DEBUG(MTD_DEBUG_LEVEL2,"ENODEV: thisNFTL = %d, minor = %d, ip = %p, fp = %p\n", DEBUG(MTD_DEBUG_LEVEL2,"ENODEV: thisNFTL = %d, minor = %d, ip = %p, fp = %p\n",
nftlnum, ip->i_rdev, ip, fp); nftlnum, minor(ip->i_rdev), ip, fp);
return -ENODEV; return -ENODEV;
} }
...@@ -967,7 +967,7 @@ static int nftl_release(struct inode *inode, struct file *fp) ...@@ -967,7 +967,7 @@ static int nftl_release(struct inode *inode, struct file *fp)
{ {
struct NFTLrecord *thisNFTL; struct NFTLrecord *thisNFTL;
thisNFTL = NFTLs[MINOR(inode->i_rdev) / 16]; thisNFTL = NFTLs[minor(inode->i_rdev) / 16];
DEBUG(MTD_DEBUG_LEVEL2, "NFTL_release\n"); DEBUG(MTD_DEBUG_LEVEL2, "NFTL_release\n");
......
...@@ -524,7 +524,7 @@ void get_sectorsize(int i) ...@@ -524,7 +524,7 @@ void get_sectorsize(int i)
scsi_CDs[i].needs_sector_size = 1; scsi_CDs[i].needs_sector_size = 1;
} else { } else {
#if 0 #if 0
if (cdrom_get_last_written(MKDEV(MAJOR_NR, i), if (cdrom_get_last_written(mkdev(MAJOR_NR, i),
&scsi_CDs[i].capacity)) &scsi_CDs[i].capacity))
#endif #endif
scsi_CDs[i].capacity = 1 + ((buffer[0] << 24) | scsi_CDs[i].capacity = 1 + ((buffer[0] << 24) |
......
...@@ -280,7 +280,7 @@ static int reint_mknod (int slot_offset, struct kml_rec *rec) ...@@ -280,7 +280,7 @@ static int reint_mknod (int slot_offset, struct kml_rec *rec)
old_fs = get_fs(); old_fs = get_fs();
set_fs (get_ds()); set_fs (get_ds());
error = lento_mknod (mknod->path, mknod->mode, error = lento_mknod (mknod->path, mknod->mode,
MKDEV(mknod->major, mknod->minor), &info); mk_kdev(mknod->major, mknod->minor), &info);
set_fs (old_fs); set_fs (old_fs);
kmlreint_post_secure (rec); kmlreint_post_secure (rec);
EXIT; EXIT;
......
...@@ -789,7 +789,7 @@ static int presto_psdev_ioctl(struct inode *inode, struct file *file, ...@@ -789,7 +789,7 @@ static int presto_psdev_ioctl(struct inode *inode, struct file *file,
} }
error = lento_mknod(input.name, input.mode, error = lento_mknod(input.name, input.mode,
MKDEV(input.major,input.minor),&input.info); mk_kdev(input.major,input.minor),&input.info);
EXIT; EXIT;
return error; return error;
} }
......
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