From patchwork Tue Jun 21 20:26:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889726 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 8EE27C433EF for ; Tue, 21 Jun 2022 20:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353370AbiFUUS7 (ORCPT ); Tue, 21 Jun 2022 16:18:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353829AbiFUUS6 (ORCPT ); Tue, 21 Jun 2022 16:18:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13BCB1D0D9 for ; Tue, 21 Jun 2022 13:18:57 -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 9FF05B81B07 for ; Tue, 21 Jun 2022 20:18:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E97FC3411C; Tue, 21 Jun 2022 20:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842735; bh=x2PiwguIMrd2VtOAUeefXIFIY9Q6YPvjrYNa4Dg7XKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dJ4j7a0NM/Zp4d8FwRabULy50M1xTWMzA2s+tN5/1FwHPxuwrbIEeeR0sw2BGA+zR oeDHzL0f5GM1xFx/UrEpBV57OkI83dG2SOkdrJYwaMxEepe2z9by1I2bh96NgXQT+O 8wP3XevYNzrBvs6hbKjjbR6ywl62+b0Oo0AuOBh7KcFexJZLJt5eSmVTwt5UfWe0b5 qVij840qom2iW9c/FtUJ83X6nwyNLqC0H6F8+yTo5kcrPCGGUP3Ck9mxHUxQTh7l3Y 1zEslFpZ0MBvj6MmORSfTf0Q6dTage6x93DZec6ZlzLRIrjNaPWC0bNgqzafbRFGtQ cKLlTSdLbThKw== 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 06/36] iio: adc: mt6577_auxadc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:49 +0100 Message-Id: <20220621202719.13644-7-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 Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron Cc: Zhiyong Tao Cc: Hui Liu --- drivers/iio/adc/mt6577_auxadc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c index e78c96a185db..0e134777bdd2 100644 --- a/drivers/iio/adc/mt6577_auxadc.c +++ b/drivers/iio/adc/mt6577_auxadc.c @@ -215,7 +215,7 @@ static const struct iio_info mt6577_auxadc_info = { .read_raw = &mt6577_auxadc_read_raw, }; -static int __maybe_unused mt6577_auxadc_resume(struct device *dev) +static int mt6577_auxadc_resume(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); @@ -234,7 +234,7 @@ static int __maybe_unused mt6577_auxadc_resume(struct device *dev) return 0; } -static int __maybe_unused mt6577_auxadc_suspend(struct device *dev) +static int mt6577_auxadc_suspend(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev); @@ -330,9 +330,9 @@ static int mt6577_auxadc_remove(struct platform_device *pdev) return 0; } -static SIMPLE_DEV_PM_OPS(mt6577_auxadc_pm_ops, - mt6577_auxadc_suspend, - mt6577_auxadc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mt6577_auxadc_pm_ops, + mt6577_auxadc_suspend, + mt6577_auxadc_resume); static const struct of_device_id mt6577_auxadc_of_match[] = { { .compatible = "mediatek,mt2701-auxadc", .data = &mt8173_compat }, @@ -349,7 +349,7 @@ static struct platform_driver mt6577_auxadc_driver = { .driver = { .name = "mt6577-auxadc", .of_match_table = mt6577_auxadc_of_match, - .pm = &mt6577_auxadc_pm_ops, + .pm = pm_sleep_ptr(&mt6577_auxadc_pm_ops), }, .probe = mt6577_auxadc_probe, .remove = mt6577_auxadc_remove,