aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r--drivers/ide/ide-floppy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index a11ec86925a3..cdfadb01d07f 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -828,8 +828,8 @@ static int idefloppy_media_changed(struct gendisk *disk)
828 int ret; 828 int ret;
829 829
830 /* do not scan partitions twice if this is a removable device */ 830 /* do not scan partitions twice if this is a removable device */
831 if (drive->attach) { 831 if (drive->dev_flags & IDE_DFLAG_ATTACH) {
832 drive->attach = 0; 832 drive->dev_flags &= ~IDE_DFLAG_ATTACH;
833 return 0; 833 return 0;
834 } 834 }
835 ret = !!(drive->atapi_flags & IDE_AFLAG_MEDIA_CHANGED); 835 ret = !!(drive->atapi_flags & IDE_AFLAG_MEDIA_CHANGED);
@@ -896,12 +896,13 @@ static int ide_floppy_probe(ide_drive_t *drive)
896 drive->debug_mask = debug_mask; 896 drive->debug_mask = debug_mask;
897 897
898 idefloppy_setup(drive, floppy); 898 idefloppy_setup(drive, floppy);
899 drive->dev_flags |= IDE_DFLAG_ATTACH;
899 900
900 g->minors = 1 << PARTN_BITS; 901 g->minors = 1 << PARTN_BITS;
901 g->driverfs_dev = &drive->gendev; 902 g->driverfs_dev = &drive->gendev;
902 g->flags = drive->removable ? GENHD_FL_REMOVABLE : 0; 903 if (drive->dev_flags & IDE_DFLAG_REMOVABLE)
904 g->flags = GENHD_FL_REMOVABLE;
903 g->fops = &idefloppy_ops; 905 g->fops = &idefloppy_ops;
904 drive->attach = 1;
905 add_disk(g); 906 add_disk(g);
906 return 0; 907 return 0;
907 908