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

« back to all changes in this revision

Viewing changes to drivers/ide/ide-cd.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:
258
258
        if (time_after(jiffies, info->write_timeout))
259
259
                return 0;
260
260
        else {
261
 
                struct request_queue *q = drive->queue;
262
 
                unsigned long flags;
263
 
 
264
261
                /*
265
 
                 * take a breather relying on the unplug timer to kick us again
 
262
                 * take a breather
266
263
                 */
267
 
 
268
 
                spin_lock_irqsave(q->queue_lock, flags);
269
 
                blk_plug_device(q);
270
 
                spin_unlock_irqrestore(q->queue_lock, flags);
271
 
 
 
264
                blk_delay_queue(drive->queue, 1);
272
265
                return 1;
273
266
        }
274
267
}
785
778
                                        sector_t block)
786
779
{
787
780
        struct ide_cmd cmd;
788
 
        int uptodate = 0, nsectors;
 
781
        int uptodate = 0;
 
782
        unsigned int nsectors;
789
783
 
790
784
        ide_debug_log(IDE_DBG_RQ, "cmd: 0x%x, block: %llu",
791
785
                                  rq->cmd[0], (unsigned long long)block);
1177
1171
        .open                   = ide_cdrom_open_real,
1178
1172
        .release                = ide_cdrom_release_real,
1179
1173
        .drive_status           = ide_cdrom_drive_status,
1180
 
        .media_changed          = ide_cdrom_check_media_change_real,
 
1174
        .check_events           = ide_cdrom_check_events_real,
1181
1175
        .tray_move              = ide_cdrom_tray_move,
1182
1176
        .lock_door              = ide_cdrom_lock_door,
1183
1177
        .select_speed           = ide_cdrom_select_speed,
1514
1508
        blk_queue_dma_alignment(q, 31);
1515
1509
        blk_queue_update_dma_pad(q, 15);
1516
1510
 
1517
 
        q->unplug_delay = max((1 * HZ) / 1000, 1);
1518
 
 
1519
1511
        drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
1520
1512
        drive->atapi_flags = IDE_AFLAG_NO_EJECT | ide_cd_flags(id);
1521
1513
 
1702
1694
}
1703
1695
 
1704
1696
 
1705
 
static int idecd_media_changed(struct gendisk *disk)
 
1697
static unsigned int idecd_check_events(struct gendisk *disk,
 
1698
                                       unsigned int clearing)
1706
1699
{
1707
1700
        struct cdrom_info *info = ide_drv_g(disk, cdrom_info);
1708
 
        return cdrom_media_changed(&info->devinfo);
 
1701
        return cdrom_check_events(&info->devinfo, clearing);
1709
1702
}
1710
1703
 
1711
1704
static int idecd_revalidate_disk(struct gendisk *disk)
1723
1716
        .open                   = idecd_open,
1724
1717
        .release                = idecd_release,
1725
1718
        .ioctl                  = idecd_ioctl,
1726
 
        .media_changed          = idecd_media_changed,
 
1719
        .check_events           = idecd_check_events,
1727
1720
        .revalidate_disk        = idecd_revalidate_disk
1728
1721
};
1729
1722
 
1789
1782
 
1790
1783
        ide_cd_read_toc(drive, &sense);
1791
1784
        g->fops = &idecd_ops;
1792
 
        g->flags |= GENHD_FL_REMOVABLE;
 
1785
        g->flags |= GENHD_FL_REMOVABLE | GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE;
1793
1786
        add_disk(g);
1794
1787
        return 0;
1795
1788