Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp108022pxb; Tue, 10 Nov 2020 21:51:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJytZu9Xl3z4RNFcfoex9/q9gRcT33XVtOEhYHAZ2D5Wcm28/rrVQUuTVn/YimqOx+BmdwFL X-Received: by 2002:a05:6402:c8d:: with SMTP id cm13mr3059075edb.340.1605073868635; Tue, 10 Nov 2020 21:51:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605073868; cv=none; d=google.com; s=arc-20160816; b=y1bsxqf/ABE+WYICv55EMW0u1aa31oAUdE2ln9Qp2/Ai4nMDkoCRuopPU4yI4PCrlt g98BsBFFIUTFac9Y+K0YAX+AaavQFGwMFNp8INOpHTHQgyF252LSEbsPo9wO4sC6ZdUt IBtNUw3JG0hiG9CrJA3FY4j8cc3KPj67rLC64NGKqCdmMnOVJgaLpz5Qlr8yb6RlT5QC mKL7kH5WTNILltqDCBW1O28Wp6+dd8W+gryyxE+6MA+6mc4NfNMlytADpXMYZBqBX4a8 rUQtnnFMJiethmSkjKsJdg7qVGNmq6zpW8n6AIg5+n2IIniURgS1YV1G8dYIXCwgSfp1 K9Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:ironport-sdr:ironport-sdr; bh=nBLmnTIHqK93NHHXMC8yYbL48YJY6/FmyTLQmsiKkII=; b=Cz5dY4xP9vQu0WVPcNVJsoJVxTBG71+6drF+wnnfsu07rIgWu1onAIsnillWeRyESc gLil+G/fLbgD9vqJE9niaQI9oBDwrXgskiWKRWF9slA8v9lFducehtpB52L3I32akrCv WHO+HyQzZ3VGVDy8HRBG0BnWw2Q80UM9M2IHM4M2zfQpQfGUwZ7h+RlVlMx7T0j5m/0A Z1t1b+j4F+Z0nOYnm8qgiNiBOJfJ1t6sp5twG7KDFqL7Ke2XnW1jjiacsmPdQ1BBbq5v ix/ldvbI3lFYvMH/oy248YeiMyxTvoq6nxHtQM9UP6czDV9GFVX9FaGszJY3n9NaPrVf 3vGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l30si705668edl.99.2020.11.10.21.50.45; Tue, 10 Nov 2020 21:51:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725960AbgKKFtN (ORCPT + 99 others); Wed, 11 Nov 2020 00:49:13 -0500 Received: from mga07.intel.com ([134.134.136.100]:43317 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbgKKFtL (ORCPT ); Wed, 11 Nov 2020 00:49:11 -0500 IronPort-SDR: LUi8RJhV8hrbqbzlUGVS5Y90IGT5gWsxEdXFIC42kkUoR2AjVIOGSPE61r7NabxQTe8eOx9RpZ FPWDFoFXkIWg== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="234263653" X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="234263653" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 21:49:08 -0800 IronPort-SDR: OWzgtDSwc83Sx2x0TyK831KhNCjvBKLd8K/TSF5eg6lkvgJRfiFlD5SJWGjJ+XrmkWdCxdOF34 d1cJFueasE+g== X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="308336366" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 21:49:05 -0800 From: Chen Yu To: intel-wired-lan@lists.osuosl.org Cc: "Neftin, Sasha" , Len Brown , "Rafael J. Wysocki" , "Brandt, Todd E" , Zhang Rui , Tony Nguyen , Jesse Brandeburg , linux-kernel@vger.kernel.org, Chen Yu Subject: [PATCH 2/4][RFC] PM: sleep: export device_pm_remove() for driver use Date: Wed, 11 Nov 2020 13:51:33 +0800 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Export device_pm_remove() and move the declaration of device_pm_remove() into generic power header file so that the drivers could use this interface to disable power management on that device. Signed-off-by: Chen Yu --- drivers/base/power/main.c | 1 + drivers/base/power/power.h | 8 -------- include/linux/pm.h | 12 ++++++++++++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index c7ac49042cee..4693da9d7d80 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -164,6 +164,7 @@ void device_pm_remove(struct device *dev) pm_runtime_remove(dev); device_pm_check_callbacks(dev); } +EXPORT_SYMBOL_GPL(device_pm_remove); /** * device_pm_move_before - Move device in the PM core's list of active devices. diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h index 54292cdd7808..8c2e45f3e5a9 100644 --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h @@ -20,7 +20,6 @@ static inline void pm_runtime_early_init(struct device *dev) extern void pm_runtime_init(struct device *dev); extern void pm_runtime_reinit(struct device *dev); -extern void pm_runtime_remove(struct device *dev); extern u64 pm_runtime_active_time(struct device *dev); #define WAKE_IRQ_DEDICATED_ALLOCATED BIT(0) @@ -85,7 +84,6 @@ static inline void pm_runtime_early_init(struct device *dev) static inline void pm_runtime_init(struct device *dev) {} static inline void pm_runtime_reinit(struct device *dev) {} -static inline void pm_runtime_remove(struct device *dev) {} static inline int dpm_sysfs_add(struct device *dev) { return 0; } static inline void dpm_sysfs_remove(struct device *dev) {} @@ -109,7 +107,6 @@ static inline struct device *to_device(struct list_head *entry) extern void device_pm_sleep_init(struct device *dev); extern void device_pm_add(struct device *); -extern void device_pm_remove(struct device *); extern void device_pm_move_before(struct device *, struct device *); extern void device_pm_move_after(struct device *, struct device *); extern void device_pm_move_last(struct device *); @@ -133,11 +130,6 @@ static inline void device_pm_sleep_init(struct device *dev) {} static inline void device_pm_add(struct device *dev) {} -static inline void device_pm_remove(struct device *dev) -{ - pm_runtime_remove(dev); -} - static inline void device_pm_move_before(struct device *deva, struct device *devb) {} static inline void device_pm_move_after(struct device *deva, diff --git a/include/linux/pm.h b/include/linux/pm.h index 47aca6bac1d6..f9ceca6ac7ff 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -701,6 +701,11 @@ struct dev_pm_domain { * be able to use wakeup events to exit from runtime low-power states, * or from system low-power states such as standby or suspend-to-RAM. */ +#ifdef CONFIG_PM +extern void pm_runtime_remove(struct device *dev); +#else +static inline void pm_runtime_remove(struct device *dev) {} +#endif #ifdef CONFIG_PM_SLEEP extern void device_pm_lock(void); @@ -753,6 +758,8 @@ extern void pm_generic_complete(struct device *dev); extern bool dev_pm_skip_resume(struct device *dev); extern bool dev_pm_skip_suspend(struct device *dev); +extern void device_pm_remove(struct device *dev); + #else /* !CONFIG_PM_SLEEP */ #define device_pm_lock() do {} while (0) @@ -774,6 +781,11 @@ static inline void dpm_for_each_dev(void *data, void (*fn)(struct device *, void { } +static inline void device_pm_remove(struct device *dev) +{ + pm_runtime_remove(dev); +} + #define pm_generic_prepare NULL #define pm_generic_suspend_late NULL #define pm_generic_suspend_noirq NULL -- 2.17.1