aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 12:09:10 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 12:09:10 -0400
commitae9f9f073963c56dcc4601ed9a0921eda1e8fa9d (patch)
tree27e9e2e335945d493286116c0090e82fe307185c /drivers/ide
parent81ee1bb51fff76aaa738668b92406b5117f125ed (diff)
ide-{disk,floppy}: set IDE_DFLAG_ATTACH in *_setup()
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>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-disk.c18
-rw-r--r--drivers/ide/ide-floppy.c3
2 files changed, 12 insertions, 9 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 289a533afbd6..70b75f23a70e 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -716,6 +716,14 @@ static void idedisk_setup(ide_drive_t *drive)
716 drive->dev_flags |= IDE_DFLAG_WCACHE; 716 drive->dev_flags |= IDE_DFLAG_WCACHE;
717 717
718 set_wcache(drive, 1); 718 set_wcache(drive, 1);
719
720 if ((drive->dev_flags & IDE_DFLAG_LBA) == 0 &&
721 (drive->head == 0 || drive->head > 16)) {
722 printk(KERN_ERR "%s: invalid geometry: %d physical heads?\n",
723 drive->name, drive->head);
724 drive->dev_flags &= ~IDE_DFLAG_ATTACH;
725 } else
726 drive->dev_flags |= IDE_DFLAG_ATTACH;
719} 727}
720 728
721static void ide_cacheflush_p(ide_drive_t *drive) 729static void ide_cacheflush_p(ide_drive_t *drive)
@@ -957,20 +965,14 @@ static int ide_disk_probe(ide_drive_t *drive)
957 drive->driver_data = idkp; 965 drive->driver_data = idkp;
958 966
959 idedisk_setup(drive); 967 idedisk_setup(drive);
960 if ((drive->dev_flags & IDE_DFLAG_LBA) == 0 && 968
961 (drive->head == 0 || drive->head > 16)) { 969 set_capacity(g, ide_disk_capacity(drive));
962 printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n",
963 drive->name, drive->head);
964 drive->dev_flags &= ~IDE_DFLAG_ATTACH;
965 } else
966 drive->dev_flags |= IDE_DFLAG_ATTACH;
967 970
968 g->minors = IDE_DISK_MINORS; 971 g->minors = IDE_DISK_MINORS;
969 g->driverfs_dev = &drive->gendev; 972 g->driverfs_dev = &drive->gendev;
970 g->flags |= GENHD_FL_EXT_DEVT; 973 g->flags |= GENHD_FL_EXT_DEVT;
971 if (drive->dev_flags & IDE_DFLAG_REMOVABLE) 974 if (drive->dev_flags & IDE_DFLAG_REMOVABLE)
972 g->flags = GENHD_FL_REMOVABLE; 975 g->flags = GENHD_FL_REMOVABLE;
973 set_capacity(g, ide_disk_capacity(drive));
974 g->fops = &idedisk_ops; 976 g->fops = &idedisk_ops;
975 add_disk(g); 977 add_disk(g);
976 return 0; 978 return 0;
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 73458e46bf1e..bcbd980f7a48 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -598,6 +598,8 @@ static void idefloppy_setup(ide_drive_t *drive, idefloppy_floppy_t *floppy)
598 (void) ide_floppy_get_capacity(drive); 598 (void) ide_floppy_get_capacity(drive);
599 599
600 ide_proc_register_driver(drive, floppy->driver); 600 ide_proc_register_driver(drive, floppy->driver);
601
602 drive->dev_flags |= IDE_DFLAG_ATTACH;
601} 603}
602 604
603static void ide_floppy_remove(ide_drive_t *drive) 605static void ide_floppy_remove(ide_drive_t *drive)
@@ -807,7 +809,6 @@ static int ide_floppy_probe(ide_drive_t *drive)
807 drive->debug_mask = debug_mask; 809 drive->debug_mask = debug_mask;
808 810
809 idefloppy_setup(drive, floppy); 811 idefloppy_setup(drive, floppy);
810 drive->dev_flags |= IDE_DFLAG_ATTACH;
811 812
812 g->minors = 1 << PARTN_BITS; 813 g->minors = 1 << PARTN_BITS;
813 g->driverfs_dev = &drive->gendev; 814 g->driverfs_dev = &drive->gendev;