From patchwork Tue Sep 4 14:24:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 1402531 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 508D63FC71 for ; Tue, 4 Sep 2012 14:26:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932296Ab2IDOZ7 (ORCPT ); Tue, 4 Sep 2012 10:25:59 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:62706 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932295Ab2IDOZ4 (ORCPT ); Tue, 4 Sep 2012 10:25:56 -0400 Received: by mail-pz0-f46.google.com with SMTP id y13so4438855dad.19 for ; Tue, 04 Sep 2012 07:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=wXLYZSo0nPhBrtdGKWMN0xBCpOOfnejXC7gMLXY0/CM=; b=Dix9d6ZkKxbqP7w6xEtlroA0ty/q2PHNk7V07D1GnUUBpH4Xf3FkdZ6P5bCc4MfuuI wvpT/IyKiOMPtJW26n2gsXSW9U/FRmh/d6H0nAQkS4FknxaDrn1DWzHLhTnTvZFZ8Wct 3t4x6u4s3mTQk3Td6ASN4r/egbDWViENy0DiW5mrWIahn1vawPA/mXA8yuLqkTkYJz19 MeIWbTID18B9qkjLoXUGf4JnWJecGp2K60HraZohmY0BScEt72qsxjQEyq9bWc4zxdUq yNYb4Imy4Sc9XXxDVbdZb+KsvciKWET0wQ7t3JJTePAq0gN8cnlrXZAUhhUb5gRiS+W7 ZL7w== Received: by 10.68.217.202 with SMTP id pa10mr47020096pbc.15.1346768756413; Tue, 04 Sep 2012 07:25:56 -0700 (PDT) Received: from localhost.localdomain.localdomain ([180.157.93.243]) by mx.google.com with ESMTPS id lb1sm12311440pbc.47.2012.09.04.07.25.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 07:25:55 -0700 (PDT) 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 v6 6/7] scsi: sr: use may_power_off Date: Tue, 4 Sep 2012 22:24:39 +0800 Message-Id: <1346768680-7287-7-git-send-email-aaron.lwe@gmail.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1346768680-7287-1-git-send-email-aaron.lwe@gmail.com> References: <1346768680-7287-1-git-send-email-aaron.lwe@gmail.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Aaron Lu 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 a5bb687..291f38c 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);