~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/block/ataflop.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1324
1324
 * due to unrecognised disk changes.
1325
1325
 */
1326
1326
 
1327
 
static int check_floppy_change(struct gendisk *disk)
 
1327
static unsigned int floppy_check_events(struct gendisk *disk,
 
1328
                                        unsigned int clearing)
1328
1329
{
1329
1330
        struct atari_floppy_struct *p = disk->private_data;
1330
1331
        unsigned int drive = p - unit;
1331
1332
        if (test_bit (drive, &fake_change)) {
1332
1333
                /* simulated change (e.g. after formatting) */
1333
 
                return 1;
 
1334
                return DISK_EVENT_MEDIA_CHANGE;
1334
1335
        }
1335
1336
        if (test_bit (drive, &changed_floppies)) {
1336
1337
                /* surely changed (the WP signal changed at least once) */
1337
 
                return 1;
 
1338
                return DISK_EVENT_MEDIA_CHANGE;
1338
1339
        }
1339
1340
        if (UD.wpstat) {
1340
1341
                /* WP is on -> could be changed: to be sure, buffers should be
1341
1342
                 * invalidated...
1342
1343
                 */
1343
 
                return 1;
 
1344
                return DISK_EVENT_MEDIA_CHANGE;
1344
1345
        }
1345
1346
 
1346
1347
        return 0;
1570
1571
                 * or the next access will revalidate - and clear UDT :-(
1571
1572
                 */
1572
1573
 
1573
 
                if (check_floppy_change(disk))
 
1574
                if (floppy_check_events(disk, 0))
1574
1575
                        floppy_revalidate(disk);
1575
1576
 
1576
1577
                if (UD.flags & FTD_MSG)
1904
1905
        .open           = floppy_unlocked_open,
1905
1906
        .release        = floppy_release,
1906
1907
        .ioctl          = fd_ioctl,
1907
 
        .media_changed  = check_floppy_change,
 
1908
        .check_events   = floppy_check_events,
1908
1909
        .revalidate_disk= floppy_revalidate,
1909
1910
};
1910
1911