]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-floppy.c
[PATCH] ide: MODALIAS support for autoloading of ide-cd, ide-disk, ...
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-floppy.c
index 29c22fc278c6510b75209ea6fea80649fe23fe77..fba3fffc2d6635561e4157e311145d916053247c 100644 (file)
@@ -1925,8 +1925,8 @@ static ide_proc_entry_t idefloppy_proc[] = {
 static int ide_floppy_probe(struct device *);
 
 static ide_driver_t idefloppy_driver = {
-       .owner                  = THIS_MODULE,
        .gen_driver = {
+               .owner          = THIS_MODULE,
                .name           = "ide-floppy",
                .bus            = &ide_bus_type,
                .probe          = ide_floppy_probe,
@@ -2038,11 +2038,9 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
        struct ide_floppy_obj *floppy = ide_floppy_g(bdev->bd_disk);
        ide_drive_t *drive = floppy->drive;
        void __user *argp = (void __user *)arg;
-       int err = generic_ide_ioctl(drive, file, bdev, cmd, arg);
+       int err;
        int prevent = (arg) ? 1 : 0;
        idefloppy_pc_t pc;
-       if (err != -EINVAL)
-               return err;
 
        switch (cmd) {
        case CDROMEJECT:
@@ -2094,7 +2092,7 @@ static int idefloppy_ioctl(struct inode *inode, struct file *file,
        case IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS:
                return idefloppy_get_format_progress(drive, argp);
        }
-       return -EINVAL;
+       return generic_ide_ioctl(drive, file, bdev, cmd, arg);
 }
 
 static int idefloppy_media_changed(struct gendisk *disk)
@@ -2146,7 +2144,7 @@ static int ide_floppy_probe(struct device *dev)
                printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name);
                goto failed;
        }
-       if ((floppy = (idefloppy_floppy_t *) kmalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
+       if ((floppy = (idefloppy_floppy_t *) kzalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
                printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name);
                goto failed;
        }
@@ -2159,8 +2157,6 @@ static int ide_floppy_probe(struct device *dev)
 
        ide_register_subdriver(drive, &idefloppy_driver);
 
-       memset(floppy, 0, sizeof(*floppy));
-
        kref_init(&floppy->kref);
 
        floppy->drive = drive;
@@ -2195,15 +2191,13 @@ static void __exit idefloppy_exit (void)
        driver_unregister(&idefloppy_driver.gen_driver);
 }
 
-/*
- *     idefloppy_init will register the driver for each floppy.
- */
-static int idefloppy_init (void)
+static int __init idefloppy_init(void)
 {
        printk("ide-floppy driver " IDEFLOPPY_VERSION "\n");
        return driver_register(&idefloppy_driver.gen_driver);
 }
 
+MODULE_ALIAS("ide:*m-floppy*");
 module_init(idefloppy_init);
 module_exit(idefloppy_exit);
 MODULE_LICENSE("GPL");