From patchwork Tue Jun 21 20:27:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889747 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 E8277C43334 for ; Tue, 21 Jun 2022 20:21:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354288AbiFUUVt (ORCPT ); Tue, 21 Jun 2022 16:21:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354270AbiFUUVs (ORCPT ); Tue, 21 Jun 2022 16:21:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 916B21CFCD for ; Tue, 21 Jun 2022 13:21:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3A76FB81B07 for ; Tue, 21 Jun 2022 20:21:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FD82C341C4; Tue, 21 Jun 2022 20:21:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842904; bh=HbjaOA7TS98EFXbjcc9Y6vkfsmMhGl1nN8KOKQdKBOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vx5p+mo6CVx+YPnayjVrEWI9t1bWxNS3xKxX3vxnNrvUW7VYuLq15QNuxlKLk/3DQ CHTNa+3jRUzFyXT0MsJi4mE0VDzmvxIcnq7/sVLFGsrKU2+0mDze/o8CTDpNZmRV1l KFDGtxyAZ+FTVJ8rsJonHcxTrlFAMfGDae7J2jlknsLokOx6ETYqnS+ZsArA1YgtwP qEizP9zJVGYvG8wYazph+Id6D7jffa991yf1Ea9xDmOlOWcWBXfPG9iNvb7djuqZrO LymOeSfSkHJP+akHfhq1hYEeYBEOJXAYLsuwoFrWejg4F4ow661c5EguprT4QEuj8R c6D03aa9htjFg== From: Jonathan Cameron To: linux-iio@vger.kernel.org, Paul Cercueil Cc: Alexandre Belloni , Brian Masney , David Heidelberg , Cai Huoqing , Christian Eggers , Enric Balletbo i Serra , Eugen Hristev , Gwendal Grignou , Haibo Chen , Hui Liu , Joe Sandom , "Ismail H . Kose" , Lars-Peter Clausen , Linus Walleij , Ludovic Desroches , Nicolas Ferre , Marcus Folkesson , Martin Blumenstingl , Mathieu Othacehe , Michal Simek , Miquel Raynal , =?utf-8?q?Nuno_S=C3=A1?= , Parthiban Nallathambi , Philippe Reynes , Philippe Schenker , Rishi Gupta , Roan van Dijk , Stephen Boyd , Tomasz Duszynski , Zhiyong Tao , Jonathan Cameron Subject: [PATCH 27/36] iio: adc: imx8qxp: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr() Date: Tue, 21 Jun 2022 21:27:10 +0100 Message-Id: <20220621202719.13644-28-jic23@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220621202719.13644-1-jic23@kernel.org> References: <20220621202719.13644-1-jic23@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Switching to these newer macros allows the compiler to remove the unused functions and struct dev_pm_ops if !CONFIG_PM without the need to mark anything __maybe_unused. Signed-off-by: Jonathan Cameron Cc: Cai Huoqing Reviewed-by: Haibo Chen --- drivers/iio/adc/imx8qxp-adc.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/iio/adc/imx8qxp-adc.c b/drivers/iio/adc/imx8qxp-adc.c index e8c9a69e10eb..e48446784a0a 100644 --- a/drivers/iio/adc/imx8qxp-adc.c +++ b/drivers/iio/adc/imx8qxp-adc.c @@ -417,7 +417,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev) return 0; } -static __maybe_unused int imx8qxp_adc_runtime_suspend(struct device *dev) +static int imx8qxp_adc_runtime_suspend(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct imx8qxp_adc *adc = iio_priv(indio_dev); @@ -431,7 +431,7 @@ static __maybe_unused int imx8qxp_adc_runtime_suspend(struct device *dev) return 0; } -static __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev) +static int imx8qxp_adc_runtime_resume(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct imx8qxp_adc *adc = iio_priv(indio_dev); @@ -468,10 +468,9 @@ static __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev) return ret; } -static const struct dev_pm_ops imx8qxp_adc_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(imx8qxp_adc_runtime_suspend, imx8qxp_adc_runtime_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(imx8qxp_adc_pm_ops, + imx8qxp_adc_runtime_suspend, + imx8qxp_adc_runtime_resume, NULL); static const struct of_device_id imx8qxp_adc_match[] = { { .compatible = "nxp,imx8qxp-adc", }, @@ -485,7 +484,7 @@ static struct platform_driver imx8qxp_adc_driver = { .driver = { .name = ADC_DRIVER_NAME, .of_match_table = imx8qxp_adc_match, - .pm = &imx8qxp_adc_pm_ops, + .pm = pm_ptr(&imx8qxp_adc_pm_ops), }, };