From patchwork Tue Jun 21 20:26:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889725 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 766A5C43334 for ; Tue, 21 Jun 2022 20:18:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353327AbiFUUSv (ORCPT ); Tue, 21 Jun 2022 16:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353370AbiFUUSu (ORCPT ); Tue, 21 Jun 2022 16:18:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 033331CFCD for ; Tue, 21 Jun 2022 13:18:50 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 8CCF1617C0 for ; Tue, 21 Jun 2022 20:18:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27297C341C4; Tue, 21 Jun 2022 20:18:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842729; bh=ZVo5W6uwva7QBmpp/yht+4hpbNEb+/jkE57WTOxF3eg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iEF6e5+jhzRMrSUynDv7ddCxj6k+BjA87fZQPP/04TFQgvIGOt12foL/E6Ggd3XEe ixLudVAMz/OhvnFS/yX0p96UjUp7IZMpXp2MvXzlAZ6uDfHGzLgJnPvXZSLc24MTQ+ xqRo+OUp1bFt+SD1Ic+ysQjbOIb+Q0icPFjKjnVcWwxZAlgaYlzzCqwOA0b3tlK9wC SR960NsSdi0S1flABNsrRDxVGEunSsVHz1zj7CzABPTXVZ/Kw5um04BsgN1GwTKDXx 7xm8C8r8l9xgYzluyJeR6fFpgLbysigaLKt4RkDv8+PleVhUgFj2ua4KM23l13u14G HtUug2gt2DBpw== 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 05/36] iio: adc: meson_saradc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:48 +0100 Message-Id: <20220621202719.13644-6-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: Martin Blumenstingl Acked-by: Martin Blumenstingl --- drivers/iio/adc/meson_saradc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index c18be3c519af..1a68b099d323 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c @@ -1281,22 +1281,22 @@ static int meson_sar_adc_remove(struct platform_device *pdev) return meson_sar_adc_hw_disable(indio_dev); } -static int __maybe_unused meson_sar_adc_suspend(struct device *dev) +static int meson_sar_adc_suspend(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); return meson_sar_adc_hw_disable(indio_dev); } -static int __maybe_unused meson_sar_adc_resume(struct device *dev) +static int meson_sar_adc_resume(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); return meson_sar_adc_hw_enable(indio_dev); } -static SIMPLE_DEV_PM_OPS(meson_sar_adc_pm_ops, - meson_sar_adc_suspend, meson_sar_adc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(meson_sar_adc_pm_ops, + meson_sar_adc_suspend, meson_sar_adc_resume); static struct platform_driver meson_sar_adc_driver = { .probe = meson_sar_adc_probe, @@ -1304,7 +1304,7 @@ static struct platform_driver meson_sar_adc_driver = { .driver = { .name = "meson-saradc", .of_match_table = meson_sar_adc_of_match, - .pm = &meson_sar_adc_pm_ops, + .pm = pm_sleep_ptr(&meson_sar_adc_pm_ops), }, };