From patchwork Tue Jun 21 20:27:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889738 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 04C91C433EF for ; Tue, 21 Jun 2022 20:20:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354258AbiFUUUg (ORCPT ); Tue, 21 Jun 2022 16:20:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354256AbiFUUUf (ORCPT ); Tue, 21 Jun 2022 16:20:35 -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 D5C0A1CFCD for ; Tue, 21 Jun 2022 13:20:34 -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 98390B81B07 for ; Tue, 21 Jun 2022 20:20:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE8CEC3411C; Tue, 21 Jun 2022 20:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842832; bh=aNsWmTaWWnd1Gh7lA6RZjRrPyI4g7F6B3hrJztzlCJE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EybBLBqqI7217oAFeTUSS9E+YYeZhFI5dbpHHcJKd5RyHTUIh5SWzRpDITg6BkWKL jSF5Gbo6ts6INYuzV0I1VULf0dACO9+8ghhLtczNC8IMqY9A8qoiFL0kJIDaAXE8FB Jd+xqQksmTpL0lq1XugGVI7hzx83C7xwgmGlMvQFbtqlUQuI4em6EeHJ+Tgp0CmD+F BCN1dRvKVaD8UJW/ODwE2mgoZMqkdB/PP2BKJgbI596bg8cdIffcnYTNdnlEM9sKfQ XmbNHcpCsZKmzNbIOs0O2DQDDB8F2XPgxx9cDw8Cs3+AB0/g0JnMIok9AlHnn886QV O3vTeu8+rYqGQ== 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 18/36] iio: health: afe4404: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:27:01 +0100 Message-Id: <20220621202719.13644-19-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 --- drivers/iio/health/afe4404.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iio/health/afe4404.c b/drivers/iio/health/afe4404.c index 1bb7de60f8ca..dd7800159051 100644 --- a/drivers/iio/health/afe4404.c +++ b/drivers/iio/health/afe4404.c @@ -415,7 +415,7 @@ static const struct of_device_id afe4404_of_match[] = { }; MODULE_DEVICE_TABLE(of, afe4404_of_match); -static int __maybe_unused afe4404_suspend(struct device *dev) +static int afe4404_suspend(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct afe4404_data *afe = iio_priv(indio_dev); @@ -436,7 +436,7 @@ static int __maybe_unused afe4404_suspend(struct device *dev) return 0; } -static int __maybe_unused afe4404_resume(struct device *dev) +static int afe4404_resume(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct afe4404_data *afe = iio_priv(indio_dev); @@ -456,7 +456,8 @@ static int __maybe_unused afe4404_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(afe4404_pm_ops, afe4404_suspend, afe4404_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(afe4404_pm_ops, afe4404_suspend, + afe4404_resume); static int afe4404_probe(struct i2c_client *client, const struct i2c_device_id *id) @@ -607,7 +608,7 @@ static struct i2c_driver afe4404_i2c_driver = { .driver = { .name = AFE4404_DRIVER_NAME, .of_match_table = afe4404_of_match, - .pm = &afe4404_pm_ops, + .pm = pm_sleep_ptr(&afe4404_pm_ops), }, .probe = afe4404_probe, .remove = afe4404_remove,