From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03288C25B0C for ; Mon, 8 Aug 2022 11:22:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242699AbiHHLWw (ORCPT ); Mon, 8 Aug 2022 07:22:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242409AbiHHLWt (ORCPT ); Mon, 8 Aug 2022 07:22:49 -0400 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6949643D; Mon, 8 Aug 2022 04:22:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1659957766; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WncN/J6jFWmOuUfW/r0Cy7asGiQzUA6y7QhuiAhEaDc=; b=go3y9ib6p4wlvAhqD+14udIU6ndNcNfw6Ei+gujiIZe2mDnjtCjzwBYhz3DCkW60MOWXwv tWWeWR1683vpLlcMa4Ygfaha8bDQUqFbOQ9gJWO/AZ/zRoSwVBQ4TdjYPdTBZNUqOaxY6r OhPbbWEtkIMqLLq4pZLiF59MhHq0XUI= Date: Mon, 08 Aug 2022 13:22:37 +0200 From: Paul Cercueil Subject: Re: [PATCH 1/5] PM: core: Add EXPORT_NS_GPL_DEV_PM_OPS to avoid drivers rolling own. To: Jonathan Cameron Cc: linux-iio@vger.kernel.org, "Rafael J . Wysocki" , linux-pm@vger.kernel.org, Sean Nyekjaer , Rui Miguel Silva , Jean-Baptiste Maneyrol , Linus Walleij , Jonathan Cameron , "Rafael J . Wysocki" Message-Id: In-Reply-To: <20220807192038.1039771-2-jic23@kernel.org> References: <20220807192038.1039771-1-jic23@kernel.org> <20220807192038.1039771-2-jic23@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Hi Jonathan, If you can wait a day or two - I would like to submit my own version of=20 EXPORT_NS_GPL_DEV_PM_OPS, which should be more versatile than your=20 version. Cheers, -Paul Le dim., ao=FBt 7 2022 at 20:20:34 +0100, Jonathan Cameron=20 a =E9crit : > From: Jonathan Cameron >=20 > A driver wishing to export a struct dev_pm_ops with both suspend and > runtime ops provided could use _EXPORT_DEV_PM_OPS() directly but > that macro is not intended for use in drivers and requires non > intuitive aspect such as passing "_gpl" as one parameter and the > namespace as a string. As such just provide a macro to cover > the GPL and NS case in a fashion that is in line with similar macros. >=20 > Signed-off-by: Jonathan Cameron > Cc: Paul Cercueil > Cc: Rafael J. Wysocki > --- > include/linux/pm.h | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/include/linux/pm.h b/include/linux/pm.h > index 871c9c49ec9d..18856e0d23ac 100644 > --- a/include/linux/pm.h > +++ b/include/linux/pm.h > @@ -407,6 +407,11 @@ static __maybe_unused=20 > _DEFINE_DEV_PM_OPS(__static_##name, suspend_fn, \ > #define EXPORT_NS_GPL_SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn,=20 > ns) \ > _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, NULL, NULL, NULL,=20 > "_gpl", #ns) >=20 > +#define EXPORT_NS_GPL_DEV_PM_OPS(name, suspend_fn, resume_fn,=20 > runtime_suspend_fn, \ > + runtime_resume_fn, idle_fn, ns) \ > + _EXPORT_DEV_PM_OPS(name, suspend_fn, resume_fn, runtime_suspend_fn,=20 > \ > + runtime_resume_fn, idle_fn, "_gpl", #ns) > + > /* Deprecated. Use DEFINE_SIMPLE_DEV_PM_OPS() instead. */ > #define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ > const struct dev_pm_ops __maybe_unused name =3D { \ > -- > 2.37.1 >=20