From patchwork Tue Jun 21 20:27:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889745 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 8DBE1C43334 for ; Tue, 21 Jun 2022 20:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354280AbiFUUVa (ORCPT ); Tue, 21 Jun 2022 16:21:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354270AbiFUUV3 (ORCPT ); Tue, 21 Jun 2022 16:21:29 -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 0679A1D31D for ; Tue, 21 Jun 2022 13:21:29 -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 9790F61807 for ; Tue, 21 Jun 2022 20:21:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0934C341C4; Tue, 21 Jun 2022 20:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842888; bh=lgmOBhm47bc5MlIZORAvhuPgQPvPdd7e85e0qwGalCY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=izl5urCQ3AGOaiwhiN0zldPEfKxKC+XUTPCsgW3FdbXtGMcbRF9hHlRWaP/88mhaY U/Cold1dvS/8g6Kt3SSMu/4PnaYkTqYfMTBHgfZBXrQY1v7R6QZHJvPve56J7WPHH3 TWdGsjLdMe/QJ4xkNKmmgo5cNsyuQTsJTVL7UdqFR1FnkR4STjL1DWB7QR0x6lHPe1 0CYjgqCH+Adx2xxHHrQoHZFpYjgRLVknhxxgMB6oneEfjOjsxmOWtGsAgNfmB7rDcH +G4eoYAL5hjdP/VyEBaf6KKAS9O6dpUYe9ai0RN/q1eed6QcdjbXaGcMsPAxumj2QY z/FPgKpdFAJeg== 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 25/36] iio: temperature: ltc2983: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:27:08 +0100 Message-Id: <20220621202719.13644-26-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: Nuno Sá Reviewed-by: Nuno Sá --- drivers/iio/temperature/ltc2983.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 4b7f2b8a9758..b652d2b39bcf 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -1534,7 +1534,7 @@ static int ltc2983_probe(struct spi_device *spi) return devm_iio_device_register(&spi->dev, indio_dev); } -static int __maybe_unused ltc2983_resume(struct device *dev) +static int ltc2983_resume(struct device *dev) { struct ltc2983_data *st = spi_get_drvdata(to_spi_device(dev)); int dummy; @@ -1545,14 +1545,15 @@ static int __maybe_unused ltc2983_resume(struct device *dev) return ltc2983_setup(st, false); } -static int __maybe_unused ltc2983_suspend(struct device *dev) +static int ltc2983_suspend(struct device *dev) { struct ltc2983_data *st = spi_get_drvdata(to_spi_device(dev)); return regmap_write(st->regmap, LTC2983_STATUS_REG, LTC2983_SLEEP); } -static SIMPLE_DEV_PM_OPS(ltc2983_pm_ops, ltc2983_suspend, ltc2983_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ltc2983_pm_ops, ltc2983_suspend, + ltc2983_resume); static const struct spi_device_id ltc2983_id_table[] = { { "ltc2983" }, @@ -1570,7 +1571,7 @@ static struct spi_driver ltc2983_driver = { .driver = { .name = "ltc2983", .of_match_table = ltc2983_of_match, - .pm = <c2983_pm_ops, + .pm = pm_sleep_ptr(<c2983_pm_ops), }, .probe = ltc2983_probe, .id_table = ltc2983_id_table,