From patchwork Tue Jun 21 20:27:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889741 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 1C249C433EF for ; Tue, 21 Jun 2022 20:21:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354268AbiFUUU7 (ORCPT ); Tue, 21 Jun 2022 16:20:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354256AbiFUUU7 (ORCPT ); Tue, 21 Jun 2022 16:20:59 -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 99FBD1CFCD for ; Tue, 21 Jun 2022 13:20:58 -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 5DBF4B81B07 for ; Tue, 21 Jun 2022 20:20:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4093AC341C4; Tue, 21 Jun 2022 20:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842856; bh=mFglGnZ2qq7YIYl4qcrkS1N+FnCS3345zhcCklI+Hbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mw31zysJolog4j4T23X3EnBy5D1Wa60sb40Va3CvpPQDww6qAuqbOo3iAHBRVQoL0 QxiOApUX+aY9VmmxRMKU+iJZlT+zzvCJx9Wz30h6nwDrahmoPUqB+Z9USEE9GsajCH zUxh6WclT9MnaiSe6t65KG5KGLZ+v3jkrzJC6f3byW26n9yj8LN9dCJAH/6QXP45XS veQJpxN0987hoNveskfbX+9nh9Kcwu1h/w/yadsXANfQvUCZ4RVMqime0diY+L4H97 KrYBSXePrcsV5RCUi43w7N5zaTWoukE2259HF/6jcigKCQpAzEUlujslgvJCs7dPmM qOdXIKKUpd1EA== 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 21/36] iio: light: as73211: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:27:04 +0100 Message-Id: <20220621202719.13644-22-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: Christian Eggers Reviewed-by: Christian Eggers --- drivers/iio/light/as73211.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iio/light/as73211.c b/drivers/iio/light/as73211.c index 3ba2378df3dd..2307fc531752 100644 --- a/drivers/iio/light/as73211.c +++ b/drivers/iio/light/as73211.c @@ -755,21 +755,22 @@ static int as73211_probe(struct i2c_client *client) return devm_iio_device_register(dev, indio_dev); } -static int __maybe_unused as73211_suspend(struct device *dev) +static int as73211_suspend(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); return as73211_power(indio_dev, false); } -static int __maybe_unused as73211_resume(struct device *dev) +static int as73211_resume(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); return as73211_power(indio_dev, true); } -static SIMPLE_DEV_PM_OPS(as73211_pm_ops, as73211_suspend, as73211_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(as73211_pm_ops, as73211_suspend, + as73211_resume); static const struct of_device_id as73211_of_match[] = { { .compatible = "ams,as73211" }, @@ -787,7 +788,7 @@ static struct i2c_driver as73211_driver = { .driver = { .name = AS73211_DRV_NAME, .of_match_table = as73211_of_match, - .pm = &as73211_pm_ops, + .pm = pm_sleep_ptr(&as73211_pm_ops), }, .probe_new = as73211_probe, .id_table = as73211_id,