From patchwork Tue Jun 21 20:26:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889728 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 4F692C433EF for ; Tue, 21 Jun 2022 20:19:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353874AbiFUUTM (ORCPT ); Tue, 21 Jun 2022 16:19:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353829AbiFUUTL (ORCPT ); Tue, 21 Jun 2022 16:19:11 -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 BEF791D0D9 for ; Tue, 21 Jun 2022 13:19:10 -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 5B6BF6181B for ; Tue, 21 Jun 2022 20:19:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDCC6C3411C; Tue, 21 Jun 2022 20:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842749; bh=eEPrs1xDJR+y6tB+19ehvO/V27G6EQJV2luVs4zGJ/4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QViiKv7+0jmsVLL2Zwti4DOgldyNYnPamgbW9ulLsa1rl/1HdBOAn0q3+h+/wz5oC /Pf/mYUa2ZaK27ahECrsEjy9RVKzuwTEpprcGOAWdo2QsjbVEQCM+7JzP/BymvQHz/ S1PvcHwZeWQ/z/VhVrc9YeQToWdgG/bc+vU7PBih+ByYjfBjWkGQPXePkqwnwRJITs Kof2nYTlmY3TlPHbwGJWGCWbFUNgb++CMMgiN9411tzDfeWwfq5RorE9Zs6aLyY8h5 okI+MzoMqFj3kvP7Awxi2VECTKg0YVmCQSA8IO9xRLr1hJFZnDKKBQHfTx+p6ad3Hx EKvmwMCdQrP5w== 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 08/36] iio: adc: ti-am335x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:51 +0100 Message-Id: <20220621202719.13644-9-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: Miquel Raynal Reviewed-by: Miquel Raynal --- drivers/iio/adc/ti_am335x_adc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index 567d43a30955..642c5c4895e3 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -702,7 +702,7 @@ static int tiadc_remove(struct platform_device *pdev) return 0; } -static int __maybe_unused tiadc_suspend(struct device *dev) +static int tiadc_suspend(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct tiadc_device *adc_dev = iio_priv(indio_dev); @@ -715,7 +715,7 @@ static int __maybe_unused tiadc_suspend(struct device *dev) return 0; } -static int __maybe_unused tiadc_resume(struct device *dev) +static int tiadc_resume(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct tiadc_device *adc_dev = iio_priv(indio_dev); @@ -732,7 +732,7 @@ static int __maybe_unused tiadc_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(tiadc_pm_ops, tiadc_suspend, tiadc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(tiadc_pm_ops, tiadc_suspend, tiadc_resume); static const struct of_device_id ti_adc_dt_ids[] = { { .compatible = "ti,am3359-adc", }, @@ -744,7 +744,7 @@ MODULE_DEVICE_TABLE(of, ti_adc_dt_ids); static struct platform_driver tiadc_driver = { .driver = { .name = "TI-am335x-adc", - .pm = &tiadc_pm_ops, + .pm = pm_sleep_ptr(&tiadc_pm_ops), .of_match_table = ti_adc_dt_ids, }, .probe = tiadc_probe,