Message ID | 20230213165005.2943219-1-rf@opensource.cirrus.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2453702wrn; Mon, 13 Feb 2023 08:56:52 -0800 (PST) X-Google-Smtp-Source: AK7set9M5rzQxnNbQaEa/jmFpEDA+nAEv1X00T/SlVWPCWoQxO5QJ8zS8juN8dRzV//H0Qv9LShd X-Received: by 2002:a17:902:ec82:b0:199:2f0a:697 with SMTP id x2-20020a170902ec8200b001992f0a0697mr26386753plg.33.1676307411839; Mon, 13 Feb 2023 08:56:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676307411; cv=none; d=google.com; s=arc-20160816; b=p3hRnQjKwQZl3r6vYbdY31VPPlh1k+n6+6VVK395hCygIihhQpTR4fapskkJaCmGmU lCZo0nuyLazzESpcdl+p1eFH1BecJGXyCgQaTl32Kx+PxA1C3Oo+rEqFvHSKHqfhu1FZ Y0pqqAhER7OWMjjjHKIQXvCwxpZDoTSOk6HLqE5Z3PoMWoFREGhF04DkjO8zzZKxxs5F bQLk5BRM2nsbpPs9LREpAANO2TYEDM+H8WEl9unGvqqKTkhZgl1Y96HpltKh6+ESTr2e AN+SAQPXwiP3docWPK9z+baewPYeigPrfK/BKDJunFS/ec0QKEmfneOpQAlYbQiZvEwN dzww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=F8TUMXGOhWtM0xhDNu8yzbORHyhxZkTgVpYiH25GvO8=; b=wf8FPVex5/U2luJkX0BDektCt7oruJ31h9zjA1hksPpW9vPNEMHSTkA4PvdPSk4HZE WZlT/A7zQpSJ3DV0yghC3zM/4KK4EX4VyH7aiXISjLIgySwBsvIyEsA0ypShdl/nulTv NyYiD6lanhAdLKVoAE31I/Wm9zsaPeTXu1JjcLwpF80tyTrGwcwAH3bR9qZjdgF8Xzao OIHDJdSBp70t5RW4DOEStIZ+FSpoaVU/A7mEbZ+6PHKR8W1UQozfX2QZTLClFqVy9gZR FSwQvhGMsB+T0myqU9OlCFc1sfmcuZwMOsiwqW4s74xB3SwbOsdeKU4Ji0dCuFgUoopg LpEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b="K/0j7v7P"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u8-20020a170902e5c800b0019623669853si13860839plf.576.2023.02.13.08.56.39; Mon, 13 Feb 2023 08:56:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b="K/0j7v7P"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbjBMQuX (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Mon, 13 Feb 2023 11:50:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbjBMQuV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Feb 2023 11:50:21 -0500 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A082C10DD; Mon, 13 Feb 2023 08:50:20 -0800 (PST) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31D5v5hL009266; Mon, 13 Feb 2023 10:50:07 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=F8TUMXGOhWtM0xhDNu8yzbORHyhxZkTgVpYiH25GvO8=; b=K/0j7v7Pgo4OnPfgAPRgefKbh7vLwBtbnsrrhuqzexvGkfLBDtliqn6jko9g3+K0iS7p YmNHUsSqG+fY8iKLXZbJuZEfKZKHPtvkMpiTSK+DUQqw9ppeqxl7bXwnfpCyIgOCfSN+ ccumCn2W/9DHn3QsOlG8UJv93WfFgw+dLmN382exbfHfFNIKA3TP8ieGIOTj3p8lGLx9 GTUK359t/2DadHM+g1+BOd9XgIfmveB5uUMDcAw+HcxpQDvG7K85iMHdlUbQQvts+eJc ybz6fZ+45Z+IDnnOwzmZn6IgiKZd628LjgSgHmD0r9D2CMqZiFQHp9O10W2JyRsk8Tv/ pA== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3np9a72fk8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Feb 2023 10:50:07 -0600 Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.21; Mon, 13 Feb 2023 10:50:05 -0600 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.21 via Frontend Transport; Mon, 13 Feb 2023 10:50:05 -0600 Received: from edi-sw-dsktp-006.ad.cirrus.com (edi-sw-dsktp-006.ad.cirrus.com [198.90.251.127]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 723EA11AA; Mon, 13 Feb 2023 16:50:05 +0000 (UTC) From: Richard Fitzgerald <rf@opensource.cirrus.com> To: <rafael@kernel.org>, <pavel@ucw.cz>, <len.brown@intel.com> CC: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <patches@opensource.cirrus.com>, Richard Fitzgerald <rf@opensource.cirrus.com> Subject: [PATCH v2] PM: Add EXPORT macros for exporting PM functions Date: Mon, 13 Feb 2023 16:50:05 +0000 Message-ID: <20230213165005.2943219-1-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: N1uBgpY4xXvU798yocea3UNUbfImLfqN X-Proofpoint-ORIG-GUID: N1uBgpY4xXvU798yocea3UNUbfImLfqN X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757735720326192031?= X-GMAIL-MSGID: =?utf-8?q?1757735720326192031?= |
Series |
[v2] PM: Add EXPORT macros for exporting PM functions
|
|
Commit Message
Richard Fitzgerald
Feb. 13, 2023, 4:50 p.m. UTC
Add a pair of macros for exporting functions only if CONFIG_PM
is enabled.
The naming follows the style of the standard EXPORT_SYMBOL_*()
macros that they replace.
Sometimes a module wants to export PM functions directly to other
drivers, not a complete struct dev_pm_ops. A typical example is
where a core library exports the generic (shared) implementation
and calling code wraps one or more of these in custom code.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
include/linux/pm.h | 4 ++++
1 file changed, 4 insertions(+)
Comments
On Mon, Feb 13, 2023 at 5:50 PM Richard Fitzgerald <rf@opensource.cirrus.com> wrote: > > Add a pair of macros for exporting functions only if CONFIG_PM > is enabled. > > The naming follows the style of the standard EXPORT_SYMBOL_*() > macros that they replace. > > Sometimes a module wants to export PM functions directly to other > drivers, not a complete struct dev_pm_ops. A typical example is > where a core library exports the generic (shared) implementation > and calling code wraps one or more of these in custom code. > > Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> > --- > include/linux/pm.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/include/linux/pm.h b/include/linux/pm.h > index 93cd34f00822..035d9649eba4 100644 > --- a/include/linux/pm.h > +++ b/include/linux/pm.h > @@ -379,9 +379,13 @@ const struct dev_pm_ops name = { \ > const struct dev_pm_ops name; \ > __EXPORT_SYMBOL(name, sec, ns); \ > const struct dev_pm_ops name > +#define EXPORT_PM_FN_GPL(name) EXPORT_SYMBOL_GPL(name) > +#define EXPORT_PM_FN_NS_GPL(name, ns) EXPORT_SYMBOL_NS_GPL(name, ns) > #else > #define _EXPORT_DEV_PM_OPS(name, sec, ns) \ > static __maybe_unused const struct dev_pm_ops __static_##name > +#define EXPORT_PM_FN_GPL(name) > +#define EXPORT_PM_FN_NS_GPL(name, ns) > #endif > > #define EXPORT_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "", "") > -- Applied as 6.3 material, thanks!
diff --git a/include/linux/pm.h b/include/linux/pm.h index 93cd34f00822..035d9649eba4 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -379,9 +379,13 @@ const struct dev_pm_ops name = { \ const struct dev_pm_ops name; \ __EXPORT_SYMBOL(name, sec, ns); \ const struct dev_pm_ops name +#define EXPORT_PM_FN_GPL(name) EXPORT_SYMBOL_GPL(name) +#define EXPORT_PM_FN_NS_GPL(name, ns) EXPORT_SYMBOL_NS_GPL(name, ns) #else #define _EXPORT_DEV_PM_OPS(name, sec, ns) \ static __maybe_unused const struct dev_pm_ops __static_##name +#define EXPORT_PM_FN_GPL(name) +#define EXPORT_PM_FN_NS_GPL(name, ns) #endif #define EXPORT_DEV_PM_OPS(name) _EXPORT_DEV_PM_OPS(name, "", "")