From patchwork Tue Jun 21 20:26:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889730 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 43BF1C433EF for ; Tue, 21 Jun 2022 20:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353829AbiFUUTb (ORCPT ); Tue, 21 Jun 2022 16:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354017AbiFUUTa (ORCPT ); Tue, 21 Jun 2022 16:19:30 -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 CA7A81CFCD for ; Tue, 21 Jun 2022 13:19: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 ams.source.kernel.org (Postfix) with ESMTPS id 8C594B81809 for ; Tue, 21 Jun 2022 20:19:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24F46C3411C; Tue, 21 Jun 2022 20:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842767; bh=2VOKrsbJJyFWIQ+Jx64qLLEpnySDWXWZeeq6TPRQzXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u71zx0eEJzwq5BO14M0v49eH203ytIOxl5P4X9JN1bwlVrbO2YScLOeFPhlchWwXx YZs5wkFoIpJj+ISdMZNLie7vylE6WzFtdF3wMNjBOJ3Riaz1h4dgttbi0yeY/rcdtw r6ERqQssL7m8/FCkJA8lYaqrHVYp6ahmR4/maF9R3isFNx0ngtUfaO9GbpxmTyERX8 Nl47zidaqbU4g6mqFbj+tbQLqwsDFBwEaSG6eCfEX94xn5y0OS5q5s+zZE8MElmVwl /KzQvGkoDKUB9yU9tYEK62eJ+ahfPcjGxp5lrF55v+UGE7K/oeNphl/R+fM+zMrqaq SEImKaAmv/a2Q== 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 10/36] iio: chemical: scd4x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:53 +0100 Message-Id: <20220621202719.13644-11-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: Roan van Dijk --- drivers/iio/chemical/scd4x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/chemical/scd4x.c b/drivers/iio/chemical/scd4x.c index 37143b5526ee..54066532ea45 100644 --- a/drivers/iio/chemical/scd4x.c +++ b/drivers/iio/chemical/scd4x.c @@ -551,7 +551,7 @@ static const struct iio_chan_spec scd4x_channels[] = { }, }; -static int __maybe_unused scd4x_suspend(struct device *dev) +static int scd4x_suspend(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct scd4x_state *state = iio_priv(indio_dev); @@ -564,7 +564,7 @@ static int __maybe_unused scd4x_suspend(struct device *dev) return regulator_disable(state->vdd); } -static int __maybe_unused scd4x_resume(struct device *dev) +static int scd4x_resume(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct scd4x_state *state = iio_priv(indio_dev); @@ -577,7 +577,7 @@ static int __maybe_unused scd4x_resume(struct device *dev) return scd4x_send_command(state, CMD_START_MEAS); } -static __maybe_unused SIMPLE_DEV_PM_OPS(scd4x_pm_ops, scd4x_suspend, scd4x_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(scd4x_pm_ops, scd4x_suspend, scd4x_resume); static void scd4x_stop_meas(void *state) { @@ -688,7 +688,7 @@ static struct i2c_driver scd4x_i2c_driver = { .driver = { .name = KBUILD_MODNAME, .of_match_table = scd4x_dt_ids, - .pm = &scd4x_pm_ops + .pm = pm_sleep_ptr(&scd4x_pm_ops), }, .probe = scd4x_probe, };