From patchwork Tue Jun 21 20:26:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889727 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 50C36C43334 for ; Tue, 21 Jun 2022 20:19:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353834AbiFUUTG (ORCPT ); Tue, 21 Jun 2022 16:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353829AbiFUUTF (ORCPT ); Tue, 21 Jun 2022 16:19:05 -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 078F41D0DF for ; Tue, 21 Jun 2022 13:19:05 -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 B825EB81B25 for ; Tue, 21 Jun 2022 20:19:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0D4FC341C4; Tue, 21 Jun 2022 20:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842742; bh=2xO87HhT38VDOw5b4Fn6tFwR4OECAouBEKFn/DWq+/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I0eOSFKD5Lo23ZE0tTyKINEBltNdOG/VOUyT9kxGI3FHksqRcIPUFfL96+AY+AwY0 MNqdladPuneIN3ELbhC9aaj0Xfcd/JnryA/yDUx4hfPYJsL30arahAIOukC7Ep+FFM +Rww+hXrfEf1vvG49MzCRR10c6D6me2yYbVTCsQUWtn1WYKfhIfpEVZ2DIBhvJB6nm 9wPzGA/FYVVmrWX5eYb5LXw0mlMePybhR0X9RrBa1E+2rjm5Ylts2vlx2FbC4qHxaW 7dnXv+rKX1KEV9+6z5M0sJ1ypp2eqqm4SEsuUUQCmS0pH7bPXJa/JT9982hEtgWCfl RjWzdPd6U/zkQ== 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 07/36] iio: adc: stmpe-adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:50 +0100 Message-Id: <20220621202719.13644-8-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. This one is a little unusual as no suspend callback, but the cleanup is still worthwhile (and eventual aim is to get rid of old macro). Signed-off-by: Jonathan Cameron Cc: Philippe Schenker --- drivers/iio/adc/stmpe-adc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c index 000e5cfecb43..67518e460e05 100644 --- a/drivers/iio/adc/stmpe-adc.c +++ b/drivers/iio/adc/stmpe-adc.c @@ -333,7 +333,7 @@ static int stmpe_adc_probe(struct platform_device *pdev) return devm_iio_device_register(&pdev->dev, indio_dev); } -static int __maybe_unused stmpe_adc_resume(struct device *dev) +static int stmpe_adc_resume(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct stmpe_adc *info = iio_priv(indio_dev); @@ -343,7 +343,7 @@ static int __maybe_unused stmpe_adc_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume); static const struct of_device_id stmpe_adc_ids[] = { { .compatible = "st,stmpe-adc", }, @@ -355,7 +355,7 @@ static struct platform_driver stmpe_adc_driver = { .probe = stmpe_adc_probe, .driver = { .name = "stmpe-adc", - .pm = &stmpe_adc_pm_ops, + .pm = pm_sleep_ptr(&stmpe_adc_pm_ops), .of_match_table = stmpe_adc_ids, }, };