Commit b85e4ca0 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] compile fixes, xd.c switched to per-disk gendisks

Misc.  compile fixes, xd.c switched to per-disk gendisks, Alan's 2.4
fixes for xd.c ported.
parent d843f16d
......@@ -157,7 +157,7 @@ static struct gendisk ps2esdi_gendisk[2] = {
nr_real: 1
},{
major: MAJOR_NR,
first_minor: 64
first_minor: 64,
major_name: "edb",
minor_shift: 6,
part: ps2esdi+64,
......@@ -491,7 +491,6 @@ static void do_ps2esdi_request(request_queue_t * q)
u_int block, count;
/* since, this routine is called with interrupts cleared - they
must be before it finishes */
sti();
#if 0
printk("%s:got request. device : %d minor : %d command : %d sector : %ld count : %ld, buffer: %p\n",
......@@ -604,13 +603,16 @@ static void ps2esdi_readwrite(int cmd, u_char drive, u_int block, u_int count)
CURRENT->current_nr_sectors, drive);
/* send the command block to the controller */
spin_unlock_irq(&ps2esdi_lock);
if (ps2esdi_out_cmd_blk(cmd_blk)) {
spin_lock_irq(&ps2esdi_lock);
printk("%s: Controller failed\n", DEVICE_NAME);
if ((++CURRENT->errors) >= MAX_RETRIES)
end_request(CURRENT, FAIL);
}
/* check for failure to put out the command block */
else {
spin_lock_irq(&ps2esdi_lock);
#if 0
printk("%s: waiting for xfer\n", DEVICE_NAME);
#endif
......@@ -1099,7 +1101,7 @@ static int ps2esdi_ioctl(struct inode *inode,
put_user(ps2esdi_info[dev].head, (char *) &geometry->heads);
put_user(ps2esdi_info[dev].sect, (char *) &geometry->sectors);
put_user(ps2esdi_info[dev].cyl, (short *) &geometry->cylinders);
put_user(get_start_sect(inode->b_rdev), (long *) &geometry->start);
put_user(get_start_sect(inode->i_bdev), (long *) &geometry->start);
return 0;
}
......
......@@ -818,7 +818,7 @@ static void del_battery_timer(void)
static int mm_revalidate(kdev_t i_rdev)
{
int card_number = DEVICE_NR(i_rdev);
mm_partitions[minor(i_rdev)] = cards[card_number].mm_size << 1;
mm_partitions[minor(i_rdev)].nr_sects = cards[card_number].mm_size << 1;
return 0;
}
/*
......@@ -828,7 +828,7 @@ static int mm_revalidate(kdev_t i_rdev)
*/
static int mm_ioctl(struct inode *i, struct file *f, unsigned int cmd, unsigned long arg)
{
if (cmd == case HDIO_GETGEO) {
if (cmd == HDIO_GETGEO) {
unsigned int minor = minor(i->i_rdev);
int err, size, card_number = (minor >> MM_SHIFT);
struct hd_geometry geo;
......
This diff is collapsed.
......@@ -108,7 +108,6 @@ static int xd_manual_geo_init (char *command);
#endif /* MODULE */
static u_char xd_detect (u_char *controller, unsigned int *address);
static u_char xd_initdrives (void (*init_drive)(u_char drive));
static void xd_geninit (void);
static int xd_open (struct inode *inode,struct file *file);
static void do_xd_request (request_queue_t * q);
......@@ -119,7 +118,6 @@ static void xd_recalibrate (u_char drive);
static void xd_interrupt_handler (int irq, void *dev_id, struct pt_regs *regs);
static u_char xd_setup_dma (u_char opcode,u_char *buffer,u_int count);
static u_char *xd_build (u_char *cmdblk,u_char command,u_char drive,u_char head,u_short cylinder,u_char sector,u_char count,u_char control);
static void xd_wakeup (unsigned long unused);
static void xd_watchdog (unsigned long unused);
static inline u_char xd_waitport (u_short port,u_char flags,u_char mask,u_long timeout);
static u_int xd_command (u_char *command,u_char mode,u_char *indata,u_char *outdata,u_char *sense,u_long timeout);
......
......@@ -849,7 +849,7 @@ static void __init hd_geninit(void)
}
for(drive=0; drive < NR_HD; drive++) {
hd_gendisk[i].nr_real = 1;
hd_gendisk[drive].nr_real = 1;
add_gendisk(hd_gendisk + drive);
register_disk(hd_gendisk + drive,
mk_kdev(MAJOR_NR,drive<<6), 1<<6,
......
......@@ -147,7 +147,6 @@ char *disk_name (struct gendisk *hd, int minor, char *buf)
maj = s;
break;
case ACSI_MAJOR:
case XT_DISK_MAJOR:
case I2O_MAJOR:
case DASD_MAJOR:
sprintf(s, "%s%c", hd->major_name, unit + 'a');
......
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