aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-disk.c
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/ide-disk.c
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/ide-disk.c')
-rw-r--r--drivers/ide/ide-disk.c18
1 files changed, 10 insertions, 8 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;