Skip to content

Commit

Permalink
[libata] Utilize new SCSI event infrastructure
Browse files Browse the repository at this point in the history
An end to CD-ROM polling (if you have a device that supports AN)...
hooray!

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Jeff Garzik committed Nov 4, 2007
1 parent a341cd0 commit f26792d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,9 @@ static void ata_scsi_dev_config(struct scsi_device *sdev,
blk_queue_max_hw_segments(q, q->max_hw_segments - 1);
}

if (dev->flags & ATA_DFLAG_AN)
set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);

if (dev->flags & ATA_DFLAG_NCQ) {
int depth;

Expand Down Expand Up @@ -3296,10 +3299,9 @@ static void ata_scsi_handle_link_detach(struct ata_link *link)
*/
void ata_scsi_media_change_notify(struct ata_device *dev)
{
#ifdef OTHER_AN_PATCHES_HAVE_BEEN_APPLIED
if (dev->sdev)
scsi_device_event_notify(dev->sdev, SDEV_MEDIA_CHANGE);
#endif
sdev_evt_send_simple(dev->sdev, SDEV_EVT_MEDIA_CHANGE,
GFP_ATOMIC);
}

/**
Expand Down

0 comments on commit f26792d

Please sign in to comment.