From patchwork Fri Aug 31 09:42:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 1392511 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4B2B2DF215 for ; Fri, 31 Aug 2012 09:43:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752419Ab2HaJnc (ORCPT ); Fri, 31 Aug 2012 05:43:32 -0400 Received: from mga02.intel.com ([134.134.136.20]:64686 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752228Ab2HaJnX (ORCPT ); Fri, 31 Aug 2012 05:43:23 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 31 Aug 2012 02:43:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,346,1344236400"; d="scan'208";a="194023807" Received: from aaronlu.sh.intel.com ([10.239.36.129]) by orsmga002.jf.intel.com with ESMTP; 31 Aug 2012 02:43:20 -0700 From: Aaron Lu To: Alan Stern , James Bottomley , Jeff Garzik Cc: linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org, linux-pm@vger.kernel.org, linux-acpi@vger.kernel.org, Aaron Lu , Aaron Lu Subject: [PATCH v5 6/7] scsi: sr: use may_power_off Date: Fri, 31 Aug 2012 17:42:34 +0800 Message-Id: <1346406155-4768-7-git-send-email-aaron.lu@intel.com> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <1346406155-4768-1-git-send-email-aaron.lu@intel.com> References: <1346406155-4768-1-git-send-email-aaron.lu@intel.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org With the introduction of may_power_off, when deciding if we can block events checking, may_power_off should be used. Signed-off-by: Aaron Lu --- drivers/scsi/sr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 1acfe0e..6b843d1 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -204,7 +204,7 @@ static int sr_suspend(struct device *dev, pm_message_t msg) if (!suspend) return -EBUSY; - if (cd->device->can_power_off) { + if (cd->device->may_power_off) { cd->disk_events_blocked = 1; disk_block_events(cd->disk); } @@ -794,6 +794,9 @@ static int sr_probe(struct device *dev) sdev_printk(KERN_DEBUG, sdev, "Attached scsi CD-ROM %s\n", cd->cdi.name); + if (cd->device->can_power_off) + cd->device->may_power_off = 1; + /* enable runtime pm */ scsi_autopm_put_device(cd->device);