From patchwork Tue Jun 21 20:26:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889732 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 6A600C43334 for ; Tue, 21 Jun 2022 20:19:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354050AbiFUUTp (ORCPT ); Tue, 21 Jun 2022 16:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354017AbiFUUTo (ORCPT ); Tue, 21 Jun 2022 16:19:44 -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 1AFEB1CFCD for ; Tue, 21 Jun 2022 13:19:44 -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 C5BE2B81809 for ; Tue, 21 Jun 2022 20:19:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF6C9C3411C; Tue, 21 Jun 2022 20:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842781; bh=oQVK8zu9RDGROfQmKal1LUbnVDhdKjLWODLPg13kPwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RM+k9jC2tvWSW/o/lG23zWtu/8OlQwWu2qR3Ip4HrAkv4un0SMDJp6qlSXTJaYpds 1lbjyRd97mmaZiLFXieqy7ym9OgqGRLgoi7tKyUvkq+e8Hm/VDpvVsgy3g9Z9DQopE ZAymCexpf8+HMQstnEmzNXoo7P/pl1SgX5B8qXKAIiVAdh4Sf4td6DsN0lo+A2Rqx9 AIIk31O60cKS0O0rmDjJXSl3x1mEdFs6KwIx2KOfXxdzJeISCzN3mNIlNVcHHrGkHr Hb0/212gk9kE2o68Th/PMjDulxK4oVl9QJ7yjcTe3BSbrZU+xIlRcdt+kt+cXUPp98 oMPTp0xek5ExQ== 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 12/36] iio: dac: ltc1660: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:55 +0100 Message-Id: <20220621202719.13644-13-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: Marcus Folkesson Reviewed-by: Marcus Folkesson --- drivers/iio/dac/ltc1660.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iio/dac/ltc1660.c b/drivers/iio/dac/ltc1660.c index c76233c9bb72..2758fc8a5ad5 100644 --- a/drivers/iio/dac/ltc1660.c +++ b/drivers/iio/dac/ltc1660.c @@ -137,20 +137,21 @@ static const struct iio_info ltc1660_info = { .write_raw = <c1660_write_raw, }; -static int __maybe_unused ltc1660_suspend(struct device *dev) +static int ltc1660_suspend(struct device *dev) { struct ltc1660_priv *priv = iio_priv(spi_get_drvdata( to_spi_device(dev))); return regmap_write(priv->regmap, LTC1660_REG_SLEEP, 0x00); } -static int __maybe_unused ltc1660_resume(struct device *dev) +static int ltc1660_resume(struct device *dev) { struct ltc1660_priv *priv = iio_priv(spi_get_drvdata( to_spi_device(dev))); return regmap_write(priv->regmap, LTC1660_REG_WAKE, 0x00); } -static SIMPLE_DEV_PM_OPS(ltc1660_pm_ops, ltc1660_suspend, ltc1660_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ltc1660_pm_ops, ltc1660_suspend, + ltc1660_resume); static int ltc1660_probe(struct spi_device *spi) { @@ -233,7 +234,7 @@ static struct spi_driver ltc1660_driver = { .driver = { .name = "ltc1660", .of_match_table = ltc1660_dt_ids, - .pm = <c1660_pm_ops, + .pm = pm_sleep_ptr(<c1660_pm_ops), }, .probe = ltc1660_probe, .remove = ltc1660_remove,