From patchwork Tue Jun 21 20:27:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889737 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 895E5C43334 for ; Tue, 21 Jun 2022 20:20:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354017AbiFUUU0 (ORCPT ); Tue, 21 Jun 2022 16:20:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354263AbiFUUUZ (ORCPT ); Tue, 21 Jun 2022 16:20:25 -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 62B721CFCD for ; Tue, 21 Jun 2022 13:20:24 -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 00394617F4 for ; Tue, 21 Jun 2022 20:20:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C3DEC341C4; Tue, 21 Jun 2022 20:20:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842823; bh=a9COZF0+ZiVAqmNEfLj92B/D6i34BlC7qy9zHSzB3u4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZcNT3Qi17sSpwuMTzvE4MqvUGpN8Ic8c4BMEGzJWF8Q9/PPL4KG7mF5UFI81e4qbA A+R8QOJuwJ3eKUkVBUO1VvIKl93OtlPcf7Imn7GLGNWGQ1wlpJEHMHfhKHQ/729jSw fDAWy56RzkukAiM1p3wLyEeLCmQQDXSgPIwrMlehin6FVJkkcPkukV9VEgTtV/4aBu 6hy93Vsnj5LusfBTRLTqVB6R0oCSWHqr2hf0TYXro+S/yUTd8ui1ePJ3dREE/4LgBv CmEA40ZleC2AP1l8Cvvz5J1nazUUihLlh7A/0qchu6gBQ4o00y6kl+3icf+3y9+Adp 7L9moPfDE0ekQ== 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 17/36] iio: health: afe4403: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:27:00 +0100 Message-Id: <20220621202719.13644-18-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/afe4403.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c index 856ec901b091..3bb4028c5d74 100644 --- a/drivers/iio/health/afe4403.c +++ b/drivers/iio/health/afe4403.c @@ -408,7 +408,7 @@ static const struct of_device_id afe4403_of_match[] = { }; MODULE_DEVICE_TABLE(of, afe4403_of_match); -static int __maybe_unused afe4403_suspend(struct device *dev) +static int afe4403_suspend(struct device *dev) { struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev)); struct afe4403_data *afe = iio_priv(indio_dev); @@ -429,7 +429,7 @@ static int __maybe_unused afe4403_suspend(struct device *dev) return 0; } -static int __maybe_unused afe4403_resume(struct device *dev) +static int afe4403_resume(struct device *dev) { struct iio_dev *indio_dev = spi_get_drvdata(to_spi_device(dev)); struct afe4403_data *afe = iio_priv(indio_dev); @@ -449,7 +449,8 @@ static int __maybe_unused afe4403_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(afe4403_pm_ops, afe4403_suspend, afe4403_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(afe4403_pm_ops, afe4403_suspend, + afe4403_resume); static int afe4403_probe(struct spi_device *spi) { @@ -598,7 +599,7 @@ static struct spi_driver afe4403_spi_driver = { .driver = { .name = AFE4403_DRIVER_NAME, .of_match_table = afe4403_of_match, - .pm = &afe4403_pm_ops, + .pm = pm_sleep_ptr(&afe4403_pm_ops), }, .probe = afe4403_probe, .remove = afe4403_remove,