From: Jeff Garzik Date: Mon, 29 Oct 2007 21:18:39 +0000 (-0400) Subject: [libata] Utilize new SCSI event infrastructure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f26792d5c63344e14540ced4b19deb29e360bb8d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 --- diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 245057df69d6..94144ed50a6b 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); } /**