X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fide%2Fide.c;h=3fdab563fec25f405a7903b8c13002206d47d45e;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=defd4b4bd37488ab38198e8ab86f963c438e2809;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index defd4b4bd..3fdab563f 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -130,6 +130,7 @@ #define _IDE_C /* Tell ide.h it's really us */ +#include #include #include #include @@ -146,6 +147,7 @@ #include #include #include +#include #include #include #include @@ -590,8 +592,13 @@ void ide_unregister(unsigned int index) goto abort; for (unit = 0; unit < MAX_DRIVES; ++unit) { drive = &hwif->drives[unit]; - if (!drive->present) + if (!drive->present) { + if (drive->devfs_name[0] != '\0') { + devfs_remove(drive->devfs_name); + drive->devfs_name[0] = '\0'; + } continue; + } spin_unlock_irq(&ide_lock); device_unregister(&drive->gendev); wait_for_completion(&drive->gendev_rel_comp); @@ -719,7 +726,6 @@ void ide_setup_ports ( hw_regs_t *hw, { int i; - memset(hw, 0, sizeof(hw_regs_t)); for (i = 0; i < IDE_NR_PORTS; i++) { if (offsets[i] == -1) { switch(i) { @@ -1219,7 +1225,7 @@ static int generic_ide_suspend(struct device *dev, pm_message_t state) memset(&args, 0, sizeof(args)); rq.flags = REQ_PM_SUSPEND; rq.special = &args; - rq.end_io_data = &rqpm; + rq.pm = &rqpm; rqpm.pm_step = ide_pm_state_start_suspend; rqpm.pm_state = state.event; @@ -1238,7 +1244,7 @@ static int generic_ide_resume(struct device *dev) memset(&args, 0, sizeof(args)); rq.flags = REQ_PM_RESUME; rq.special = &args; - rq.end_io_data = &rqpm; + rq.pm = &rqpm; rqpm.pm_step = ide_pm_state_start_resume; rqpm.pm_state = PM_EVENT_ON; @@ -1360,7 +1366,8 @@ int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device ide_abort(drive, "drive reset"); - BUG_ON(HWGROUP(drive)->handler); + if(HWGROUP(drive)->handler) + BUG(); /* Ensure nothing gets queued after we drop the lock. Reset will clear the busy */ @@ -1539,7 +1546,7 @@ static int __init ide_setup(char *s) const char *hd_words[] = { "none", "noprobe", "nowerr", "cdrom", "serialize", "autotune", "noautotune", "minus8", "swapdata", "bswap", - "noflush", "remap", "remap63", "scsi", NULL }; + "minus11", "remap", "remap63", "scsi", NULL }; unit = s[2] - 'a'; hw = unit / MAX_DRIVES; unit = unit % MAX_DRIVES; @@ -1578,9 +1585,6 @@ static int __init ide_setup(char *s) case -10: /* "bswap" */ drive->bswap = 1; goto done; - case -11: /* noflush */ - drive->noflush = 1; - goto done; case -12: /* "remap" */ drive->remap_0_to_1 = 1; goto done; @@ -1992,6 +1996,7 @@ EXPORT_SYMBOL_GPL(ide_bus_type); static int __init ide_init(void) { printk(KERN_INFO "Uniform Multi-Platform E-IDE driver " REVISION "\n"); + devfs_mk_dir("ide"); system_bus_speed = ide_system_bus_speed(); bus_register(&ide_bus_type); @@ -2069,6 +2074,7 @@ void cleanup_module (void) #ifdef CONFIG_PROC_FS proc_ide_destroy(); #endif + devfs_remove("ide"); bus_unregister(&ide_bus_type); }