diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-10-29 17:18:39 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-11-03 22:23:02 -0400 |
commit | f26792d5c63344e14540ced4b19deb29e360bb8d (patch) | |
tree | 5e4287a72bf42bd47b4b7993087e33a6d1cc0a4b | |
parent | a341cd0f6a0fde1f85fec9aa8f81f824ea4a3f92 (diff) | |
download | op-kernel-dev-f26792d5c63344e14540ced4b19deb29e360bb8d.zip op-kernel-dev-f26792d5c63344e14540ced4b19deb29e360bb8d.tar.gz |
[libata] Utilize new SCSI event infrastructure
An end to CD-ROM polling (if you have a device that supports AN)...
hooray!
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/ata/libata-scsi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 245057d..94144ed 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -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; @@ -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); } /** |