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 DCA4CCD6E5A for ; Wed, 11 Oct 2023 11:22:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234891AbjJKLW5 convert rfc822-to-8bit (ORCPT ); Wed, 11 Oct 2023 07:22:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234796AbjJKLWq (ORCPT ); Wed, 11 Oct 2023 07:22:46 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A673E136 for ; Wed, 11 Oct 2023 04:22:22 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4S59Kw1ZCYz6K61b; Wed, 11 Oct 2023 19:20:20 +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:20 +0100 Date: Wed, 11 Oct 2023 12:22:19 +0100 From: Jonathan Cameron To: Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= CC: Thierry Reding , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , , , , Florian Fainelli Subject: Re: [PATCH 06/11] pwm: imx-tpm: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Message-ID: <20231011122219.00002972@Huawei.com> In-Reply-To: <20231010075112.755178-7-u.kleine-koenig@pengutronix.de> References: <20231010075112.755178-1-u.kleine-koenig@pengutronix.de> <20231010075112.755178-7-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:07 +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 > __maybe_unused 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-imx-tpm.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/pwm/pwm-imx-tpm.c b/drivers/pwm/pwm-imx-tpm.c > index 98ab65c89685..da22f9bb367e 100644 > --- a/drivers/pwm/pwm-imx-tpm.c > +++ b/drivers/pwm/pwm-imx-tpm.c > @@ -390,7 +390,7 @@ static void pwm_imx_tpm_remove(struct platform_device *pdev) > clk_disable_unprepare(tpm->clk); > } > > -static int __maybe_unused pwm_imx_tpm_suspend(struct device *dev) > +static int pwm_imx_tpm_suspend(struct device *dev) > { > struct imx_tpm_pwm_chip *tpm = dev_get_drvdata(dev); > > @@ -409,7 +409,7 @@ static int __maybe_unused pwm_imx_tpm_suspend(struct device *dev) > return 0; > } > > -static int __maybe_unused pwm_imx_tpm_resume(struct device *dev) > +static int pwm_imx_tpm_resume(struct device *dev) > { > struct imx_tpm_pwm_chip *tpm = dev_get_drvdata(dev); > int ret = 0; > @@ -421,8 +421,8 @@ static int __maybe_unused pwm_imx_tpm_resume(struct device *dev) > return ret; > } > > -static SIMPLE_DEV_PM_OPS(imx_tpm_pwm_pm, > - pwm_imx_tpm_suspend, pwm_imx_tpm_resume); > +static DEFINE_SIMPLE_DEV_PM_OPS(imx_tpm_pwm_pm, > + pwm_imx_tpm_suspend, pwm_imx_tpm_resume); > > static const struct of_device_id imx_tpm_pwm_dt_ids[] = { > { .compatible = "fsl,imx7ulp-pwm", }, > @@ -434,7 +434,7 @@ static struct platform_driver imx_tpm_pwm_driver = { > .driver = { > .name = "imx7ulp-tpm-pwm", > .of_match_table = imx_tpm_pwm_dt_ids, > - .pm = &imx_tpm_pwm_pm, > + .pm = pm_ptr(&imx_tpm_pwm_pm), > }, > .probe = pwm_imx_tpm_probe, > .remove_new = pwm_imx_tpm_remove, 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 591B2CD6E5C for ; Wed, 11 Oct 2023 11:22:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:CC:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/aFqS/bNSFsZNXpUFoOUPwEBZaLmxsN3PxTeQZrKQnY=; b=UkBnEWVx84ntbO Q0jPdhJYlxL4bQiRtS8Jy4BY37efd4wxwCorpMxtaNOZANyfIFQqdTpiFkhqtyZ6mTdVBAS3va5nq LcaXCa0TgoqbFiJRrqqlxRnDiQmLjybHUaty+tfFU1qrSQLkyHcyprbpIMmleqhBDuVGxXiUYfLQt 8MDlXQLk5d8xCYTIxWWQv4qnnX0jdQ6ZScRFmgx6pvk0J5dku2DtrtevtzD/grN2ywOPAVZZ9sizb XIfIgMcfF/9xx9sP1HxzntZ6LOg79FhcbCdo+AN0SPfJMaGmleL1hyeAk/nDh42e692PVXdcE8Ipp sWUaJm85nBP+GzfeFJsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqXIL-00FkGQ-0q; Wed, 11 Oct 2023 11:22:29 +0000 Received: from frasgout.his.huawei.com ([185.176.79.56]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qqXII-00FkFa-22 for linux-arm-kernel@lists.infradead.org; Wed, 11 Oct 2023 11:22:28 +0000 Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4S59Kw1ZCYz6K61b; Wed, 11 Oct 2023 19:20:20 +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:20 +0100 Date: Wed, 11 Oct 2023 12:22:19 +0100 From: Jonathan Cameron To: Uwe =?ISO-8859-1?Q?Kleine-K=F6nig?= CC: Thierry Reding , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , , , , Florian Fainelli Subject: Re: [PATCH 06/11] pwm: imx-tpm: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Message-ID: <20231011122219.00002972@Huawei.com> In-Reply-To: <20231010075112.755178-7-u.kleine-koenig@pengutronix.de> References: <20231010075112.755178-1-u.kleine-koenig@pengutronix.de> <20231010075112.755178-7-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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231011_042226_819309_BFACD24F X-CRM114-Status: GOOD ( 18.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 10 Oct 2023 09:51:07 +0200 Uwe Kleine-K=F6nig 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 > __maybe_unused 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=F6nig Reviewed-by: Jonathan Cameron > --- > drivers/pwm/pwm-imx-tpm.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > = > diff --git a/drivers/pwm/pwm-imx-tpm.c b/drivers/pwm/pwm-imx-tpm.c > index 98ab65c89685..da22f9bb367e 100644 > --- a/drivers/pwm/pwm-imx-tpm.c > +++ b/drivers/pwm/pwm-imx-tpm.c > @@ -390,7 +390,7 @@ static void pwm_imx_tpm_remove(struct platform_device= *pdev) > clk_disable_unprepare(tpm->clk); > } > = > -static int __maybe_unused pwm_imx_tpm_suspend(struct device *dev) > +static int pwm_imx_tpm_suspend(struct device *dev) > { > struct imx_tpm_pwm_chip *tpm =3D dev_get_drvdata(dev); > = > @@ -409,7 +409,7 @@ static int __maybe_unused pwm_imx_tpm_suspend(struct = device *dev) > return 0; > } > = > -static int __maybe_unused pwm_imx_tpm_resume(struct device *dev) > +static int pwm_imx_tpm_resume(struct device *dev) > { > struct imx_tpm_pwm_chip *tpm =3D dev_get_drvdata(dev); > int ret =3D 0; > @@ -421,8 +421,8 @@ static int __maybe_unused pwm_imx_tpm_resume(struct d= evice *dev) > return ret; > } > = > -static SIMPLE_DEV_PM_OPS(imx_tpm_pwm_pm, > - pwm_imx_tpm_suspend, pwm_imx_tpm_resume); > +static DEFINE_SIMPLE_DEV_PM_OPS(imx_tpm_pwm_pm, > + pwm_imx_tpm_suspend, pwm_imx_tpm_resume); > = > static const struct of_device_id imx_tpm_pwm_dt_ids[] =3D { > { .compatible =3D "fsl,imx7ulp-pwm", }, > @@ -434,7 +434,7 @@ static struct platform_driver imx_tpm_pwm_driver =3D { > .driver =3D { > .name =3D "imx7ulp-tpm-pwm", > .of_match_table =3D imx_tpm_pwm_dt_ids, > - .pm =3D &imx_tpm_pwm_pm, > + .pm =3D pm_ptr(&imx_tpm_pwm_pm), > }, > .probe =3D pwm_imx_tpm_probe, > .remove_new =3D pwm_imx_tpm_remove, _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel