aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:16 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:16 -0400
commite698ea83a8531a6740dc657329dcf0728392d6ac (patch)
tree8627511816951524c03eb5afff630076bffbd115 /drivers/ide
parent14fa91ccbafa02a71cfb53f9c830b8c0c65119d0 (diff)
ide-cd: minor ide_cdrom_setup() cleanup
Cache drive->queue in local variable and use max(). There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-cd.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 0201201c6e48..5319e7a73708 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1581,18 +1581,18 @@ static int ide_cdrom_setup(ide_drive_t *drive)
1581{ 1581{
1582 struct cdrom_info *cd = drive->driver_data; 1582 struct cdrom_info *cd = drive->driver_data;
1583 struct cdrom_device_info *cdi = &cd->devinfo; 1583 struct cdrom_device_info *cdi = &cd->devinfo;
1584 struct request_queue *q = drive->queue;
1584 u16 *id = drive->id; 1585 u16 *id = drive->id;
1585 char *fw_rev = (char *)&id[ATA_ID_FW_REV]; 1586 char *fw_rev = (char *)&id[ATA_ID_FW_REV];
1586 int nslots; 1587 int nslots;
1587 1588
1588 ide_debug_log(IDE_DBG_PROBE, "enter"); 1589 ide_debug_log(IDE_DBG_PROBE, "enter");
1589 1590
1590 blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn); 1591 blk_queue_prep_rq(q, ide_cdrom_prep_fn);
1591 blk_queue_dma_alignment(drive->queue, 31); 1592 blk_queue_dma_alignment(q, 31);
1592 blk_queue_update_dma_pad(drive->queue, 15); 1593 blk_queue_update_dma_pad(q, 15);
1593 drive->queue->unplug_delay = (1 * HZ) / 1000; 1594
1594 if (!drive->queue->unplug_delay) 1595 q->unplug_delay = max((1 * HZ) / 1000, 1);
1595 drive->queue->unplug_delay = 1;
1596 1596
1597 drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED; 1597 drive->dev_flags |= IDE_DFLAG_MEDIA_CHANGED;
1598 drive->atapi_flags = IDE_AFLAG_NO_EJECT | ide_cd_flags(id); 1598 drive->atapi_flags = IDE_AFLAG_NO_EJECT | ide_cd_flags(id);
@@ -1610,8 +1610,7 @@ static int ide_cdrom_setup(ide_drive_t *drive)
1610 1610
1611 nslots = ide_cdrom_probe_capabilities(drive); 1611 nslots = ide_cdrom_probe_capabilities(drive);
1612 1612
1613 /* set correct block size */ 1613 blk_queue_hardsect_size(q, CD_FRAMESIZE);
1614 blk_queue_hardsect_size(drive->queue, CD_FRAMESIZE);
1615 1614
1616 if (ide_cdrom_register(drive, nslots)) { 1615 if (ide_cdrom_register(drive, nslots)) {
1617 printk(KERN_ERR PFX "%s: %s failed to register device with the" 1616 printk(KERN_ERR PFX "%s: %s failed to register device with the"