From patchwork Tue Jun 21 20:26:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889733 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 97AD4C43334 for ; Tue, 21 Jun 2022 20:19:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354065AbiFUUTw (ORCPT ); Tue, 21 Jun 2022 16:19:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354017AbiFUUTw (ORCPT ); Tue, 21 Jun 2022 16:19:52 -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 3DEA02613C for ; Tue, 21 Jun 2022 13:19:51 -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 EAC70B81B24 for ; Tue, 21 Jun 2022 20:19:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA1F6C341C4; Tue, 21 Jun 2022 20:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842788; bh=0oSGiJpWCxBQCdZZZqvVuQT2Cw5szPuHbWL/hBhsH2E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kc1f2PJxhiGbZO4czhKfFDnnfhrbnLMGClHK3ujRm6IILi6Na5NjcppE8eCN/mIRn My4PNbQrxX6fIsQWRY3dXIJg0jGl5YdYTAsRdq9y1/MiRxiRIEJvuai0yYe1rXBFzy 1b7NKRSMV8YPI+Ip4009HMZmMiKy47PB1pGkmRBKeCoJ6eQp029woDzBemKfJ5v65s rmuuFnhrLp2mKQkUHF63qIVXmuEy6HL+266650GbR7z5Z1/CK2O/Wob9urLayyPxKu KlZoEHAkndVvZHsMBzR62CD3bBa6setU8DIhJzPs4xd/fFFnaomhrp5Ajr0n1wkmQ2 9kxC69CFk35nw== 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 13/36] iio: dac: max517: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:56 +0100 Message-Id: <20220621202719.13644-14-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: Marcus Folkesson --- drivers/iio/dac/max517.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/dac/max517.c b/drivers/iio/dac/max517.c index a6ef555153f4..373ce6ff83b7 100644 --- a/drivers/iio/dac/max517.c +++ b/drivers/iio/dac/max517.c @@ -100,21 +100,21 @@ static int max517_write_raw(struct iio_dev *indio_dev, return ret; } -static int __maybe_unused max517_suspend(struct device *dev) +static int max517_suspend(struct device *dev) { u8 outbuf = COMMAND_PD; return i2c_master_send(to_i2c_client(dev), &outbuf, 1); } -static int __maybe_unused max517_resume(struct device *dev) +static int max517_resume(struct device *dev) { u8 outbuf = 0; return i2c_master_send(to_i2c_client(dev), &outbuf, 1); } -static SIMPLE_DEV_PM_OPS(max517_pm_ops, max517_suspend, max517_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(max517_pm_ops, max517_suspend, max517_resume); static const struct iio_info max517_info = { .read_raw = max517_read_raw, @@ -201,7 +201,7 @@ MODULE_DEVICE_TABLE(i2c, max517_id); static struct i2c_driver max517_driver = { .driver = { .name = MAX517_DRV_NAME, - .pm = &max517_pm_ops, + .pm = pm_sleep_ptr(&max517_pm_ops), }, .probe = max517_probe, .id_table = max517_id,