From patchwork Tue Jun 21 20:26:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889721 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 DABC1C433EF for ; Tue, 21 Jun 2022 20:18:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354046AbiFUUSr (ORCPT ); Tue, 21 Jun 2022 16:18:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353874AbiFUUSU (ORCPT ); Tue, 21 Jun 2022 16:18:20 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEF2E175B7 for ; Tue, 21 Jun 2022 13:18:18 -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 sin.source.kernel.org (Postfix) with ESMTPS id 22633CE1BB7 for ; Tue, 21 Jun 2022 20:18:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F112C341C4; Tue, 21 Jun 2022 20:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842695; bh=wT0k2V4BfqgDPP8eWfBsEY4I+Qdr87NC2xiZZedL3HY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eewN/WNNsCu9O4f1lIsxAvrp7XI3nuv29rdj3ODWUi8WQMEWil14nA8MK81CQWpVM kdvOHLaFONTf5ent8GH4OQKbpZdsgHUbQQ5OELcn0RWFfNg5G6PEbX+RkcaeAzT8Y9 AgjqoLFuPVDVBwhI8pGyjqY888SpYFx03MT0qcJckWfoq9M12OnT1ZV54p1Bukvlga MPRMFzg/po9lP25pcxbzTeyBc/mqN+Um+PlX05fP7PXrfLjXmhUBpUhUIKE3G7PI4j a2qog0Z7aObtf9uaj8FekMMKAVI1LjASDehQXZz4IzxZdXIu3nvcDvJLDbZ6S2Q5k2 GJ+thPi3/KgMQ== 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 01/36] iio: accel: bma220: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:44 +0100 Message-Id: <20220621202719.13644-2-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/accel/bma220_spi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/accel/bma220_spi.c b/drivers/iio/accel/bma220_spi.c index b6d9ab8e2054..fcbd695e4654 100644 --- a/drivers/iio/accel/bma220_spi.c +++ b/drivers/iio/accel/bma220_spi.c @@ -289,20 +289,20 @@ static int bma220_probe(struct spi_device *spi) return devm_iio_device_register(&spi->dev, indio_dev); } -static __maybe_unused int bma220_suspend(struct device *dev) +static int bma220_suspend(struct device *dev) { struct spi_device *spi = to_spi_device(dev); return bma220_power(spi, false); } -static __maybe_unused int bma220_resume(struct device *dev) +static int bma220_resume(struct device *dev) { struct spi_device *spi = to_spi_device(dev); return bma220_power(spi, true); } -static SIMPLE_DEV_PM_OPS(bma220_pm_ops, bma220_suspend, bma220_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(bma220_pm_ops, bma220_suspend, bma220_resume); static const struct spi_device_id bma220_spi_id[] = { {"bma220", 0}, @@ -318,7 +318,7 @@ MODULE_DEVICE_TABLE(spi, bma220_spi_id); static struct spi_driver bma220_driver = { .driver = { .name = "bma220_spi", - .pm = &bma220_pm_ops, + .pm = pm_sleep_ptr(&bma220_pm_ops), .acpi_match_table = bma220_acpi_id, }, .probe = bma220_probe,