From patchwork Tue Jun 21 20:26:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889724 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 25BF8CCA473 for ; Tue, 21 Jun 2022 20:18:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352453AbiFUUSs (ORCPT ); Tue, 21 Jun 2022 16:18:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354321AbiFUUSm (ORCPT ); Tue, 21 Jun 2022 16:18:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 957AD1CB00 for ; Tue, 21 Jun 2022 13:18:41 -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 336A1617C0 for ; Tue, 21 Jun 2022 20:18:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3B9DC3411C; Tue, 21 Jun 2022 20:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842720; bh=tXUjAECGDC97pW6hCsoM/tmUG9QCEtVKk1DKRB1Ft2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lr3Mb7zggQ1zHxZu6DU7+NKq6et8EmRysin5REdkgA2gxFkpJmOw9Rw+aw9Yd/wOH 4U5MSYnKx8CcfS9vV7Ed3Zc5TxMAH9KCXxs5GcI0fQYFmlj3Rn7bZjummm+LIuymKa WVm4o7YjMbDy+KokuTjuQNzyAg/CIJ3kfRPKD/+3d4+wl1iHRqBOkyG4T/7rCOqoU6 lHJNJANScQpxDTYpZl1PbX8x6XzO0pomKeriEAwHabE5Lr57TMBenD3P2zqBwhlpbI c5fuTCtp5ebGMTP/d0MnkHB7BuINc6K3TwBrS8xph2bbi4NWYIBzP6Bby4E+T7VQHC JR65gz2drS7Gw== 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 04/36] iio: adc: imx7d_adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:47 +0100 Message-Id: <20220621202719.13644-5-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 In this case we only gain the ability to have the compiler drop the struct dev_pm_ops because the callbacks are called from paths other than suspend and resume. In general the purpose of this new macro is to allow automated removal of the callbacks as well, but that doesn't apply here. Signed-off-by: Jonathan Cameron Cc: Haibo Chen Reviewed-by: Haibo Chen --- drivers/iio/adc/imx7d_adc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/imx7d_adc.c b/drivers/iio/adc/imx7d_adc.c index 119217af2bde..86caff1d006b 100644 --- a/drivers/iio/adc/imx7d_adc.c +++ b/drivers/iio/adc/imx7d_adc.c @@ -540,14 +540,15 @@ static int imx7d_adc_probe(struct platform_device *pdev) return 0; } -static SIMPLE_DEV_PM_OPS(imx7d_adc_pm_ops, imx7d_adc_disable, imx7d_adc_enable); +static DEFINE_SIMPLE_DEV_PM_OPS(imx7d_adc_pm_ops, imx7d_adc_disable, + imx7d_adc_enable); static struct platform_driver imx7d_adc_driver = { .probe = imx7d_adc_probe, .driver = { .name = "imx7d_adc", .of_match_table = imx7d_adc_match, - .pm = &imx7d_adc_pm_ops, + .pm = pm_sleep_ptr(&imx7d_adc_pm_ops), }, };