From patchwork Tue Dec 9 06:19:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Lu X-Patchwork-Id: 5460561 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B8DBC9F2E8 for ; Tue, 9 Dec 2014 06:20:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C84852013D for ; Tue, 9 Dec 2014 06:20:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D424C2012B for ; Tue, 9 Dec 2014 06:20:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750912AbaLIGUA (ORCPT ); Tue, 9 Dec 2014 01:20:00 -0500 Received: from mga02.intel.com ([134.134.136.20]:56902 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750739AbaLIGUA (ORCPT ); Tue, 9 Dec 2014 01:20:00 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 08 Dec 2014 22:19:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="495857760" Received: from aaronlu.sh.intel.com ([10.239.37.127]) by orsmga003.jf.intel.com with ESMTP; 08 Dec 2014 22:16:17 -0800 Message-ID: <5486948D.1060807@intel.com> Date: Tue, 09 Dec 2014 14:19:57 +0800 From: Aaron Lu MIME-Version: 1.0 To: "Rafael J. Wysocki" , linux-scsi@vger.kernel.org CC: Alan Stern , Linux Kernel Mailing List , Linux PM list , "James E.J. Bottomley" , Vinayak Holikatti Subject: Re: [PATCH] SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM References: <3237237.IIIiULdqDt@vostro.rjw.lan> In-Reply-To: <3237237.IIIiULdqDt@vostro.rjw.lan> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 12/04/2014 09:22 AM, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > > After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is > selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks > depending on CONFIG_PM_RUNTIME may now be changed to depend on > CONFIG_PM. > > Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under > drivers/scsi/ and in include/scsi/scsi_device.h. > > Signed-off-by: Rafael J. Wysocki > --- > > Note: This depends on commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if > PM_SLEEP is selected) which is only in linux-next at the moment (via the > linux-pm tree). > > Please let me know if it is OK to take this one into linux-pm. > > --- > drivers/scsi/scsi_pm.c | 4 ++-- > drivers/scsi/scsi_priv.h | 5 ++--- > drivers/scsi/ufs/ufshcd-pci.c | 11 ++++------- > drivers/scsi/ufs/ufshcd-pltfrm.c | 11 ++++------- > include/scsi/scsi_device.h | 4 ++-- > 5 files changed, 14 insertions(+), 21 deletions(-) > > Index: linux-pm/drivers/scsi/scsi_pm.c > =================================================================== > --- linux-pm.orig/drivers/scsi/scsi_pm.c > +++ linux-pm/drivers/scsi/scsi_pm.c > @@ -213,7 +213,7 @@ static int scsi_bus_restore(struct devic > > #endif /* CONFIG_PM_SLEEP */ > > -#ifdef CONFIG_PM_RUNTIME > +#ifdef CONFIG_PM > > static int sdev_runtime_suspend(struct device *dev) > { > @@ -338,7 +338,7 @@ void scsi_autopm_put_host(struct Scsi_Ho > #define scsi_runtime_resume NULL > #define scsi_runtime_idle NULL > > -#endif /* CONFIG_PM_RUNTIME */ > +#endif /* CONFIG_PM */ > > const struct dev_pm_ops scsi_bus_pm_ops = { > .prepare = scsi_bus_prepare, Just one nitpeak: since scsi_pm.o is only compiled when CONFIG_PM is set, I think we can skip the #ifdef CONFIG_PM ... #endif macro in this file now. I mean something like this: Thanks, Aaron --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c index 7454498..9e43ae1 100644 --- a/drivers/scsi/scsi_pm.c +++ b/drivers/scsi/scsi_pm.c @@ -213,8 +213,6 @@ static int scsi_bus_restore(struct device *dev) #endif /* CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM_RUNTIME - static int sdev_runtime_suspend(struct device *dev) { const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; @@ -332,14 +330,6 @@ void scsi_autopm_put_host(struct Scsi_Host *shost) pm_runtime_put_sync(&shost->shost_gendev); } -#else - -#define scsi_runtime_suspend NULL -#define scsi_runtime_resume NULL -#define scsi_runtime_idle NULL - -#endif /* CONFIG_PM_RUNTIME */ - const struct dev_pm_ops scsi_bus_pm_ops = { .prepare = scsi_bus_prepare, .suspend = scsi_bus_suspend,