s = "(reserved error code)";
}
- printk(" %s -- (asc=0x%02x, ascq=0x%02x)\n",
+ printk(KERN_ERR " %s -- (asc=0x%02x, ascq=0x%02x)\n",
s, sense->asc, sense->ascq);
if (failed_command != NULL) {
lo = mid+1;
}
- printk (" The failed \"%s\" packet command was: \n \"", s);
+ printk (KERN_ERR " The failed \"%s\" packet command was: \n \"", s);
for (i=0; i<sizeof (failed_command->cmd); i++)
printk ("%02x ", failed_command->cmd[i]);
printk ("\"\n");
*/
if (sense->sense_key == NOT_READY && (sense->sks[0] & 0x80)) {
int progress = (sense->sks[1] << 8 | sense->sks[2]) * 100;
- printk(" Command is %02d%% complete\n", progress / 0xffff);
+ printk(KERN_ERR " Command is %02d%% complete\n", progress / 0xffff);
}
if (sense->sense_key == ILLEGAL_REQUEST &&
(sense->sks[0] & 0x80) != 0) {
- printk(" Error in %s byte %d",
+ printk(KERN_ERR " Error in %s byte %d",
(sense->sks[0] & 0x40) != 0 ?
"command packet" : "command data",
(sense->sks[1] << 8) + sense->sks[2]);
sense->asc == 0x3a)))
return;
- printk("%s: error code: 0x%02x sense_key: 0x%02x asc: 0x%02x ascq: 0x%02x\n",
+ printk(KERN_ERR "%s: error code: 0x%02x sense_key: 0x%02x asc: 0x%02x ascq: 0x%02x\n",
drive->name,
sense->error_code, sense->sense_key,
sense->asc, sense->ascq);
(void) ide_do_drive_cmd(drive, rq, ide_preempt);
}
-/*
- * ide_error() takes action based on the error returned by the drive.
- */
-ide_startstop_t ide_cdrom_error (ide_drive_t *drive, const char *msg, byte stat)
-{
- struct request *rq;
- byte err;
-
- err = ide_dump_atapi_status(drive, msg, stat);
- if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL)
- return ide_stopped;
- /* retry only "normal" I/O: */
- if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK | REQ_DRIVE_TASKFILE)) {
- rq->errors = 1;
- ide_end_drive_cmd(drive, stat, err);
- return ide_stopped;
- }
-
- if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) {
- /* other bits are useless when BUSY */
- rq->errors |= ERROR_RESET;
- } else {
- /* add decoding error stuff */
- }
- if (HWIF(drive)->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT))
- /* force an abort */
- HWIF(drive)->OUTB(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG);
- if (rq->errors >= ERROR_MAX) {
- DRIVER(drive)->end_request(drive, 0, 0);
- } else {
- if ((rq->errors & ERROR_RESET) == ERROR_RESET) {
- ++rq->errors;
- return ide_do_reset(drive);
- }
- ++rq->errors;
- }
- return ide_stopped;
-}
-
-ide_startstop_t ide_cdrom_abort (ide_drive_t *drive, const char *msg)
-{
- struct request *rq;
-
- if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL)
- return ide_stopped;
- /* retry only "normal" I/O: */
- if (rq->flags & (REQ_DRIVE_CMD | REQ_DRIVE_TASK | REQ_DRIVE_TASKFILE)) {
- rq->errors = 1;
- ide_end_drive_cmd(drive, BUSY_STAT, 0);
- return ide_stopped;
- }
- rq->errors |= ERROR_RESET;
- DRIVER(drive)->end_request(drive, 0, 0);
- return ide_stopped;
-}
-
static void cdrom_end_request (ide_drive_t *drive, int uptodate)
{
struct request *rq = HWGROUP(drive)->rq;
rq->flags |= REQ_FAILED;
cdrom_end_request(drive, 0);
- DRIVER(drive)->error(drive, "request sense failure", stat);
+ ide_error(drive, "request sense failure", stat);
return 1;
} else if (rq->flags & (REQ_PC | REQ_BLOCK_PC)) {
do_end_request = 1;
} else if (sense_key == ILLEGAL_REQUEST ||
sense_key == DATA_PROTECT) {
- /*
- * check if this was a write protected media
- */
- if (rq_data_dir(rq) == WRITE) {
- printk("ide-cd: media marked write protected\n");
- set_disk_ro(drive->disk, 1);
- }
-
/* No point in retrying after an illegal
request or data protect error.*/
ide_dump_status (drive, "command error", stat);
} else if ((err & ~ABRT_ERR) != 0) {
/* Go to the default handler
for other errors. */
- DRIVER(drive)->error(drive, "cdrom_decode_status",stat);
+ ide_error(drive, "cdrom_decode_status", stat);
return 1;
} else if ((++rq->errors > ERROR_MAX)) {
/* We've racked up too many retries. Abort. */
{
ide_startstop_t startstop;
struct cdrom_info *info = drive->driver_data;
+ ide_hwif_t *hwif = drive->hwif;
/* Wait for the controller to be idle. */
if (ide_wait_stat(&startstop, drive, 0, BUSY_STAT, WAIT_READY))
return startstop;
- if (info->dma) {
- if (info->cmd == READ) {
- info->dma = !HWIF(drive)->ide_dma_read(drive);
- } else if (info->cmd == WRITE) {
- info->dma = !HWIF(drive)->ide_dma_write(drive);
- } else {
- printk("ide-cd: DMA set, but not allowed\n");
- }
- }
+ if (info->dma)
+ info->dma = !hwif->dma_setup(drive);
/* Set up the controller registers. */
/* FIXME: for Virtual DMA we must check harder */
ide_execute_command(drive, WIN_PACKETCMD, handler, ATAPI_WAIT_PC, cdrom_timer_expiry);
return ide_started;
} else {
+ unsigned long flags;
+
/* packet command */
- HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG);
+ spin_lock_irqsave(&ide_lock, flags);
+ hwif->OUTBSYNC(drive, WIN_PACKETCMD, IDE_COMMAND_REG);
+ ndelay(400);
+ spin_unlock_irqrestore(&ide_lock, flags);
+
return (*handler) (drive);
}
}
struct request *rq,
ide_handler_t *handler)
{
+ ide_hwif_t *hwif = drive->hwif;
int cmd_len;
struct cdrom_info *info = drive->driver_data;
ide_startstop_t startstop;
/* Start the DMA if need be */
if (info->dma)
- (void) HWIF(drive)->ide_dma_begin(drive);
+ hwif->dma_start(drive);
return ide_started;
}
return 0;
else if (ireason == 0) {
/* Whoops... The drive is expecting to receive data from us! */
- printk("%s: read_intr: Drive wants to transfer data the "
+ printk(KERN_ERR "%s: read_intr: Drive wants to transfer data the "
"wrong way!\n", drive->name);
/* Throw some data at the drive so it doesn't hang
return 0;
} else {
/* Drive wants a command packet, or invalid ireason... */
- printk("%s: read_intr: bad interrupt reason %x\n", drive->name,
+ printk(KERN_ERR "%s: read_intr: bad interrupt reason %x\n", drive->name,
ireason);
}
ide_end_request(drive, 1, rq->nr_sectors);
return ide_stopped;
} else
- return DRIVER(drive)->error(drive, "dma error", stat);
+ return ide_error(drive, "dma error", stat);
}
/* Read the interrupt reason and the transfer length. */
/* If we're not done filling the current buffer, complain.
Otherwise, complete the command normally. */
if (rq->current_nr_sectors > 0) {
- printk ("%s: cdrom_read_intr: data underrun (%d blocks)\n",
+ printk (KERN_ERR "%s: cdrom_read_intr: data underrun (%d blocks)\n",
drive->name, rq->current_nr_sectors);
rq->flags |= REQ_FAILED;
cdrom_end_request(drive, 0);
of at least SECTOR_SIZE, as it gets hairy to keep track
of the transfers otherwise. */
if ((len % SECTOR_SIZE) != 0) {
- printk ("%s: cdrom_read_intr: Bad transfer size %d\n",
+ printk (KERN_ERR "%s: cdrom_read_intr: Bad transfer size %d\n",
drive->name, len);
if (CDROM_CONFIG_FLAGS(drive)->limit_nframes)
- printk (" This drive is not supported by this version of the driver\n");
+ printk (KERN_ERR " This drive is not supported by this version of the driver\n");
else {
- printk (" Trying to limit transfer sizes\n");
+ printk (KERN_ERR " Trying to limit transfer sizes\n");
CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1;
}
cdrom_end_request(drive, 0);
paranoid and check. */
if (rq->current_nr_sectors < bio_cur_sectors(rq->bio) &&
(rq->sector & (sectors_per_frame - 1))) {
- printk("%s: cdrom_read_from_buffer: buffer botch (%ld)\n",
+ printk(KERN_ERR "%s: cdrom_read_from_buffer: buffer botch (%ld)\n",
drive->name, (long)rq->sector);
cdrom_end_request(drive, 0);
return -1;
/* Sanity check... */
if (rq->current_nr_sectors != bio_cur_sectors(rq->bio) &&
(rq->sector & (sectors_per_frame - 1))) {
- printk ("%s: cdrom_start_read_continuation: buffer botch (%u)\n",
+ printk(KERN_ERR "%s: cdrom_start_read_continuation: buffer botch (%u)\n",
drive->name, rq->current_nr_sectors);
cdrom_end_request(drive, 0);
return ide_stopped;
rq->sense_len += thislen;
} else {
confused:
- printk ("%s: cdrom_pc_intr: The drive "
+ printk (KERN_ERR "%s: cdrom_pc_intr: The drive "
"appears confused (ireason = 0x%02x)\n",
drive->name, ireason);
rq->flags |= REQ_FAILED;
}
-/* Sleep for TIME jiffies.
- Not to be called from an interrupt handler. */
-static
-void cdrom_sleep (int time)
-{
- int sleep = time;
-
- do {
- set_current_state(TASK_INTERRUPTIBLE);
- sleep = schedule_timeout(sleep);
- } while (sleep);
-}
-
static
int cdrom_queue_packet_command(ide_drive_t *drive, struct request *rq)
{
/* The drive is in the process of loading
a disk. Retry, but wait a little to give
the drive time to complete the load. */
- cdrom_sleep(2 * HZ);
+ ssleep(2);
} else {
/* Otherwise, don't retry. */
retries = 0;
return 0;
else if (ireason == 2) {
/* Whoops... The drive wants to send data. */
- printk("%s: write_intr: wrong transfer direction!\n",
+ printk(KERN_ERR "%s: write_intr: wrong transfer direction!\n",
drive->name);
while (len > 0) {
}
} else {
/* Drive wants a command packet, or invalid ireason... */
- printk("%s: write_intr: bad interrupt reason %x\n",
+ printk(KERN_ERR "%s: write_intr: bad interrupt reason %x\n",
drive->name, ireason);
}
*/
if (dma) {
if (dma_error) {
- printk("ide-cd: dma error\n");
+ printk(KERN_ERR "ide-cd: dma error\n");
__ide_dma_off(drive);
- return DRIVER(drive)->error(drive, "dma error", stat);
+ return ide_error(drive, "dma error", stat);
}
end_that_request_chunk(rq, 1, rq->data_len);
}
if (!ptr) {
- printk("%s: confused, missing data\n", drive->name);
+ printk(KERN_ERR "%s: confused, missing data\n", drive->name);
break;
}
if (dma) {
info->dma = 0;
if ((dma_error = HWIF(drive)->ide_dma_end(drive))) {
- printk("ide-cd: write dma error\n");
+ printk(KERN_ERR "ide-cd: write dma error\n");
__ide_dma_off(drive);
}
}
*/
if (dma) {
if (dma_error)
- return DRIVER(drive)->error(drive, "dma error", stat);
+ return ide_error(drive, "dma error", stat);
ide_end_request(drive, 1, rq->nr_sectors);
return ide_stopped;
*/
uptodate = 1;
if (rq->current_nr_sectors > 0) {
- printk("%s: write_intr: data underrun (%d blocks)\n",
+ printk(KERN_ERR "%s: write_intr: data underrun (%d blocks)\n",
drive->name, rq->current_nr_sectors);
uptodate = 0;
}
int this_transfer;
if (!rq->current_nr_sectors) {
- printk("ide-cd: write_intr: oops\n");
+ printk(KERN_ERR "ide-cd: write_intr: oops\n");
break;
}
info->dma = drive->using_dma ? 1 : 0;
info->cmd = WRITE;
+ info->devinfo.media_written = 1;
+
/* Start sending the write request to the drive. */
return cdrom_start_packet_command(drive, 32768, cdrom_start_write_cont);
}
* sg request
*/
if (rq->bio) {
- if (rq->data_len & 3) {
- printk("%s: block pc not aligned, len=%d\n", drive->name, rq->data_len);
- cdrom_end_request(drive, 0);
- return ide_stopped;
- }
- info->dma = drive->using_dma;
+ int mask = drive->queue->dma_alignment;
+ unsigned long addr = (unsigned long) page_address(bio_page(rq->bio));
+
info->cmd = rq_data_dir(rq);
+ info->dma = drive->using_dma;
+
+ /*
+ * check if dma is safe
+ */
+ if ((rq->data_len & mask) || (addr & mask))
+ info->dma = 0;
}
/* Start sending the command to the drive. */
ide_stall_queue(drive, IDECD_SEEK_TIMER);
return ide_stopped;
}
- printk ("%s: DSC timeout\n", drive->name);
+ printk (KERN_ERR "%s: DSC timeout\n", drive->name);
}
CDROM_CONFIG_FLAGS(drive)->seeking = 0;
}
- if (IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap) {
+ if ((rq_data_dir(rq) == READ) && IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap) {
action = cdrom_start_seek(drive, block);
} else {
if (rq_data_dir(rq) == READ)
if (stat != 0 &&
sense->sense_key == ILLEGAL_REQUEST &&
(sense->asc == 0x24 || sense->asc == 0x20)) {
- printk ("%s: door locking not supported\n",
+ printk (KERN_ERR "%s: door locking not supported\n",
drive->name);
CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1;
stat = 0;
GFP_KERNEL);
info->toc = toc;
if (toc == NULL) {
- printk ("%s: No cdrom TOC buffer!\n", drive->name);
+ printk (KERN_ERR "%s: No cdrom TOC buffer!\n", drive->name);
return -ENOMEM;
}
}
/* Read the multisession information. */
if (toc->hdr.first_track != CDROM_LEADOUT) {
/* Read the multisession information. */
- stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp,
+ stat = cdrom_read_tocentry(drive, 0, 0, 1, (char *)&ms_tmp,
sizeof(ms_tmp), sense);
if (stat) return stat;
+
+ toc->last_session_lba = be32_to_cpu(ms_tmp.ent.addr.lba);
} else {
- ms_tmp.ent.addr.msf.minute = 0;
- ms_tmp.ent.addr.msf.second = 2;
- ms_tmp.ent.addr.msf.frame = 0;
ms_tmp.hdr.first_track = ms_tmp.hdr.last_track = CDROM_LEADOUT;
+ toc->last_session_lba = msf_to_lba(0, 2, 0); /* 0m 2s 0f */
}
#if ! STANDARD_ATAPI
- if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd)
+ if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd) {
+ /* Re-read multisession information using MSF format */
+ stat = cdrom_read_tocentry(drive, 0, 1, 1, (char *)&ms_tmp,
+ sizeof(ms_tmp), sense);
+ if (stat)
+ return stat;
+
msf_from_bcd (&ms_tmp.ent.addr.msf);
+ toc->last_session_lba = msf_to_lba(ms_tmp.ent.addr.msf.minute,
+ ms_tmp.ent.addr.msf.second,
+ ms_tmp.ent.addr.msf.frame);
+ }
#endif /* not STANDARD_ATAPI */
- toc->last_session_lba = msf_to_lba (ms_tmp.ent.addr.msf.minute,
- ms_tmp.ent.addr.msf.second,
- ms_tmp.ent.addr.msf.frame);
-
toc->xa_flag = (ms_tmp.hdr.first_track != ms_tmp.hdr.last_track);
/* Now try to get the total cdrom capacity. */
if (!cdrom_get_media_event(cdi, &med)) {
if (med.media_present)
return CDS_DISC_OK;
- if (med.door_open)
+ else if (med.door_open)
return CDS_TRAY_OPEN;
+ else
+ return CDS_NO_DISC;
}
if (sense.sense_key == NOT_READY && sense.asc == 0x04 && sense.ascq == 0x04)
* any other way to detect this...
*/
if (sense.sense_key == NOT_READY) {
- if (sense.asc == 0x3a && sense.ascq == 1)
- return CDS_NO_DISC;
- else
- return CDS_TRAY_OPEN;
+ if (sense.asc == 0x3a) {
+ if (sense.ascq == 1)
+ return CDS_NO_DISC;
+ else if (sense.ascq == 0 || sense.ascq == 2)
+ return CDS_TRAY_OPEN;
+ }
}
return CDS_DRIVE_NOT_READY;
return 0;
}
-
/*
* Close down the device. Invalidate all cached blocks.
*/
devinfo->mask |= CDC_CLOSE_TRAY;
if (!CDROM_CONFIG_FLAGS(drive)->mo_drive)
devinfo->mask |= CDC_MO_DRIVE;
- if (!CDROM_CONFIG_FLAGS(drive)->mrw)
- devinfo->mask |= CDC_MRW;
- if (!CDROM_CONFIG_FLAGS(drive)->mrw_w)
- devinfo->mask |= CDC_MRW_W;
- if (!CDROM_CONFIG_FLAGS(drive)->ram)
- devinfo->mask |= CDC_RAM;
devinfo->disk = drive->disk;
return register_cdrom(devinfo);
struct cdrom_info *info = drive->driver_data;
struct cdrom_device_info *cdi = &info->devinfo;
struct atapi_capabilities_page cap;
- int nslots = 1, mrw_write = 0, ram_write = 0;
+ int nslots = 1;
if (drive->media == ide_optical) {
CDROM_CONFIG_FLAGS(drive)->mo_drive = 1;
CDROM_CONFIG_FLAGS(drive)->ram = 1;
- printk("%s: ATAPI magneto-optical drive\n", drive->name);
+ printk(KERN_ERR "%s: ATAPI magneto-optical drive\n", drive->name);
return nslots;
}
if (ide_cdrom_get_capabilities(drive, &cap))
return 0;
- if (!cdrom_is_mrw(cdi, &mrw_write)) {
- CDROM_CONFIG_FLAGS(drive)->mrw = 1;
- if (mrw_write) {
- CDROM_CONFIG_FLAGS(drive)->mrw_w = 1;
- CDROM_CONFIG_FLAGS(drive)->ram = 1;
- }
- }
- if (!cdrom_is_random_writable(cdi, &ram_write))
- if (ram_write)
- CDROM_CONFIG_FLAGS(drive)->ram = 1;
-
if (cap.lock == 0)
CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1;
if (cap.eject)
CDROM_CONFIG_FLAGS(drive)->no_eject = 0;
if (cap.cd_r_write)
CDROM_CONFIG_FLAGS(drive)->cd_r = 1;
- if (cap.cd_rw_write)
+ if (cap.cd_rw_write) {
CDROM_CONFIG_FLAGS(drive)->cd_rw = 1;
+ CDROM_CONFIG_FLAGS(drive)->ram = 1;
+ }
if (cap.test_write)
CDROM_CONFIG_FLAGS(drive)->test_write = 1;
if (cap.dvd_ram_read || cap.dvd_r_read || cap.dvd_rom)
/* don't print speed if the drive reported 0.
*/
- printk("%s: ATAPI", drive->name);
+ printk(KERN_INFO "%s: ATAPI", drive->name);
if (CDROM_CONFIG_FLAGS(drive)->max_speed)
printk(" %dX", CDROM_CONFIG_FLAGS(drive)->max_speed);
printk(" %s", CDROM_CONFIG_FLAGS(drive)->dvd ? "DVD-ROM" : "CD-ROM");
(CDROM_CONFIG_FLAGS(drive)->cd_r)? "-R" : "",
(CDROM_CONFIG_FLAGS(drive)->cd_rw)? "/RW" : "");
- if (CDROM_CONFIG_FLAGS(drive)->mrw || CDROM_CONFIG_FLAGS(drive)->mrw_w)
- printk(" CD-MR%s", CDROM_CONFIG_FLAGS(drive)->mrw_w ? "W" : "");
-
if (CDROM_CONFIG_FLAGS(drive)->is_changer)
printk(" changer w/%d slots", nslots);
else
printk(", %dkB Cache", be16_to_cpu(cap.buffer_size));
-#ifdef CONFIG_BLK_DEV_IDEDMA
if (drive->using_dma)
- (void) HWIF(drive)->ide_dma_verbose(drive);
-#endif /* CONFIG_BLK_DEV_IDEDMA */
+ ide_dma_verbose(drive);
+
printk("\n");
return nslots;
int nslots;
blk_queue_prep_rq(drive->queue, ide_cdrom_prep_fn);
- blk_queue_dma_alignment(drive->queue, 3);
+ blk_queue_dma_alignment(drive->queue, 31);
drive->queue->unplug_delay = (1 * HZ) / 1000;
if (!drive->queue->unplug_delay)
drive->queue->unplug_delay = 1;
nslots = ide_cdrom_probe_capabilities (drive);
/*
- * set correct block size and read-only for non-ram media
+ * set correct block size
*/
- set_disk_ro(drive->disk, !CDROM_CONFIG_FLAGS(drive)->ram);
blk_queue_hardsect_size(drive->queue, CD_FRAMESIZE);
#if 0
#endif
if (ide_cdrom_register(drive, nslots)) {
- printk ("%s: ide_cdrom_setup failed to register device with the cdrom driver.\n", drive->name);
+ printk (KERN_ERR "%s: ide_cdrom_setup failed to register device with the cdrom driver.\n", drive->name);
info->devinfo.handle = NULL;
return 1;
}
struct gendisk *g = drive->disk;
if (ide_unregister_subdriver(drive)) {
- printk("%s: %s: failed to ide_unregister_subdriver\n",
+ printk(KERN_ERR "%s: %s: failed to ide_unregister_subdriver\n",
__FUNCTION__, drive->name);
return 1;
}
if (info->changer_info != NULL)
kfree(info->changer_info);
if (devinfo->handle == drive && unregister_cdrom(devinfo))
- printk("%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
+ printk(KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
kfree(info);
drive->driver_data = NULL;
blk_queue_prep_rq(drive->queue, NULL);
.supports_dsc_overlap = 1,
.cleanup = ide_cdrom_cleanup,
.do_request = ide_do_rw_cdrom,
- .sense = ide_dump_atapi_status,
- .error = ide_cdrom_error,
- .abort = ide_cdrom_abort,
.capacity = ide_cdrom_capacity,
.attach = ide_cdrom_attach,
.drives = LIST_HEAD_INIT(ide_cdrom_driver.drives),
{
struct block_device *bdev = inode->i_bdev;
ide_drive_t *drive = bdev->bd_disk->private_data;
- int err = generic_ide_ioctl(bdev, cmd, arg);
+ int err = generic_ide_ioctl(file, bdev, cmd, arg);
if (err == -EINVAL) {
struct cdrom_info *info = drive->driver_data;
- err = cdrom_ioctl(&info->devinfo, inode, cmd, arg);
+ err = cdrom_ioctl(file, &info->devinfo, inode, cmd, arg);
}
return err;
}
};
/* options */
-char *ignore = NULL;
+static char *ignore = NULL;
-MODULE_PARM(ignore, "s");
+module_param(ignore, charp, 0400);
MODULE_DESCRIPTION("ATAPI CD-ROM Driver");
static int ide_cdrom_attach (ide_drive_t *drive)
/* skip drives that we were told to ignore */
if (ignore != NULL) {
if (strstr(ignore, drive->name)) {
- printk("ide-cd: ignoring drive %s\n", drive->name);
+ printk(KERN_INFO "ide-cd: ignoring drive %s\n", drive->name);
goto failed;
}
}
if (drive->scsi) {
- printk("ide-cd: passing drive %s to ide-scsi emulation.\n", drive->name);
+ printk(KERN_INFO "ide-cd: passing drive %s to ide-scsi emulation.\n", drive->name);
goto failed;
}
info = (struct cdrom_info *) kmalloc (sizeof (struct cdrom_info), GFP_KERNEL);
if (info == NULL) {
- printk("%s: Can't allocate a cdrom structure\n", drive->name);
+ printk(KERN_ERR "%s: Can't allocate a cdrom structure\n", drive->name);
goto failed;
}
if (ide_register_subdriver(drive, &ide_cdrom_driver)) {
- printk("%s: Failed to register the driver with ide.c\n",
+ printk(KERN_ERR "%s: Failed to register the driver with ide.c\n",
drive->name);
kfree(info);
goto failed;
if (info->changer_info != NULL)
kfree(info->changer_info);
if (devinfo->handle == drive && unregister_cdrom(devinfo))
- printk ("%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
+ printk (KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
kfree(info);
drive->driver_data = NULL;
goto failed;