]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ide-{disk,floppy}: set IDE_DFLAG_ATTACH in *_setup()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 17 Oct 2008 16:09:10 +0000 (18:09 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 17 Oct 2008 16:09:10 +0000 (18:09 +0200)
There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-disk.c
drivers/ide/ide-floppy.c

index 289a533afbd699be220689c3b70b9e2ce9c30891..70b75f23a70e436d5ebd2be2ab6c3697c4b8d0df 100644 (file)
@@ -716,6 +716,14 @@ static void idedisk_setup(ide_drive_t *drive)
                drive->dev_flags |= IDE_DFLAG_WCACHE;
 
        set_wcache(drive, 1);
+
+       if ((drive->dev_flags & IDE_DFLAG_LBA) == 0 &&
+           (drive->head == 0 || drive->head > 16)) {
+               printk(KERN_ERR "%s: invalid geometry: %d physical heads?\n",
+                       drive->name, drive->head);
+               drive->dev_flags &= ~IDE_DFLAG_ATTACH;
+       } else
+               drive->dev_flags |= IDE_DFLAG_ATTACH;
 }
 
 static void ide_cacheflush_p(ide_drive_t *drive)
@@ -957,20 +965,14 @@ static int ide_disk_probe(ide_drive_t *drive)
        drive->driver_data = idkp;
 
        idedisk_setup(drive);
-       if ((drive->dev_flags & IDE_DFLAG_LBA) == 0 &&
-           (drive->head == 0 || drive->head > 16)) {
-               printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n",
-                       drive->name, drive->head);
-               drive->dev_flags &= ~IDE_DFLAG_ATTACH;
-       } else
-               drive->dev_flags |= IDE_DFLAG_ATTACH;
+
+       set_capacity(g, ide_disk_capacity(drive));
 
        g->minors = IDE_DISK_MINORS;
        g->driverfs_dev = &drive->gendev;
        g->flags |= GENHD_FL_EXT_DEVT;
        if (drive->dev_flags & IDE_DFLAG_REMOVABLE)
                g->flags = GENHD_FL_REMOVABLE;
-       set_capacity(g, ide_disk_capacity(drive));
        g->fops = &idedisk_ops;
        add_disk(g);
        return 0;
index 73458e46bf1e4e82a1b10013c461991fa4bcca08..bcbd980f7a486e9f6ff31de7ab248df340fcd7c6 100644 (file)
@@ -598,6 +598,8 @@ static void idefloppy_setup(ide_drive_t *drive, idefloppy_floppy_t *floppy)
        (void) ide_floppy_get_capacity(drive);
 
        ide_proc_register_driver(drive, floppy->driver);
+
+       drive->dev_flags |= IDE_DFLAG_ATTACH;
 }
 
 static void ide_floppy_remove(ide_drive_t *drive)
@@ -807,7 +809,6 @@ static int ide_floppy_probe(ide_drive_t *drive)
        drive->debug_mask = debug_mask;
 
        idefloppy_setup(drive, floppy);
-       drive->dev_flags |= IDE_DFLAG_ATTACH;
 
        g->minors = 1 << PARTN_BITS;
        g->driverfs_dev = &drive->gendev;