]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - drivers/ide/ide-gd.c
Revert "ide: unexport DISK_EVENT_MEDIA_CHANGE for ide-gd and ide-cd"
[thirdparty/kernel/linux.git] / drivers / ide / ide-gd.c
index 04e008e8f6f9db63776160fc2dbd928d6af33fed..f233b34ea0c0bd2b732b0b5df25d65bf8e3d9214 100644 (file)
@@ -299,8 +299,9 @@ static unsigned int ide_gd_check_events(struct gendisk *disk,
        /*
         * The following is used to force revalidation on the first open on
         * removeable devices, and never gets reported to userland as
-        * genhd->events is 0.  This is intended as removeable ide disk
-        * can't really detect MEDIA_CHANGE events.
+        * DISK_EVENT_FLAG_UEVENT isn't set in genhd->event_flags.
+        * This is intended as removable ide disk can't really detect
+        * MEDIA_CHANGE events.
         */
        ret = drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED;
        drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED;
@@ -416,6 +417,7 @@ static int ide_gd_probe(ide_drive_t *drive)
        if (drive->dev_flags & IDE_DFLAG_REMOVABLE)
                g->flags = GENHD_FL_REMOVABLE;
        g->fops = &ide_gd_ops;
+       g->events = DISK_EVENT_MEDIA_CHANGE;
        device_add_disk(&drive->gendev, g, NULL);
        return 0;