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 1352ACD6E5D for ; Wed, 11 Oct 2023 11:23:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231892AbjJKLXM convert rfc822-to-8bit (ORCPT ); Wed, 11 Oct 2023 07:23:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234777AbjJKLXA (ORCPT ); Wed, 11 Oct 2023 07:23:00 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 106E9B6; Wed, 11 Oct 2023 04:22:54 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4S59NR14qSz6K6fp; Wed, 11 Oct 2023 19:22:31 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 11 Oct 2023 12:22:51 +0100 Date: Wed, 11 Oct 2023 12:22:50 +0100 From: Jonathan Cameron To: Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= CC: Thierry Reding , Krzysztof Kozlowski , Alim Akhtar , , , , , Florian Fainelli Subject: Re: [PATCH 07/11] pwm: samsung: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Message-ID: <20231011122250.00004e96@Huawei.com> In-Reply-To: <20231010075112.755178-8-u.kleine-koenig@pengutronix.de> References: <20231010075112.755178-1-u.kleine-koenig@pengutronix.de> <20231010075112.755178-8-u.kleine-koenig@pengutronix.de> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org On Tue, 10 Oct 2023 09:51:08 +0200 Uwe Kleine-König wrote: > This macro has the advantage over SIMPLE_DEV_PM_OPS that we don't have to > care about when the functions are actually used, so the corresponding > #ifdef can be dropped. > > Also make use of pm_ptr() to discard all PM related stuff if CONFIG_PM > isn't enabled. > > Signed-off-by: Uwe Kleine-König Reviewed-by: Jonathan Cameron > --- > drivers/pwm/pwm-samsung.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c > index e8828f57ab15..041e2f9476ff 100644 > --- a/drivers/pwm/pwm-samsung.c > +++ b/drivers/pwm/pwm-samsung.c > @@ -630,7 +630,6 @@ static void pwm_samsung_remove(struct platform_device *pdev) > clk_disable_unprepare(chip->base_clk); > } > > -#ifdef CONFIG_PM_SLEEP > static int pwm_samsung_resume(struct device *dev) > { > struct samsung_pwm_chip *our_chip = dev_get_drvdata(dev); > @@ -663,14 +662,13 @@ static int pwm_samsung_resume(struct device *dev) > > return 0; > } > -#endif > > -static SIMPLE_DEV_PM_OPS(pwm_samsung_pm_ops, NULL, pwm_samsung_resume); > +static DEFINE_SIMPLE_DEV_PM_OPS(pwm_samsung_pm_ops, NULL, pwm_samsung_resume); > > static struct platform_driver pwm_samsung_driver = { > .driver = { > .name = "samsung-pwm", > - .pm = &pwm_samsung_pm_ops, > + .pm = pm_ptr(&pwm_samsung_pm_ops), > .of_match_table = of_match_ptr(samsung_pwm_matches), > }, > .probe = pwm_samsung_probe,