From patchwork Tue Jun 21 20:26:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889731 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 CAB45C43334 for ; Tue, 21 Jun 2022 20:19:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354033AbiFUUTk (ORCPT ); Tue, 21 Jun 2022 16:19:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354017AbiFUUTj (ORCPT ); Tue, 21 Jun 2022 16:19:39 -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 B3B762613C for ; Tue, 21 Jun 2022 13:19:38 -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 0F32CCE1C39 for ; Tue, 21 Jun 2022 20:19:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EC99C341C4; Tue, 21 Jun 2022 20:19:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842775; bh=gRHf8QVxLTOp4IR+16PDiLQPXJOi9Sjm3BEQHvf9SZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oHiRvUnVTNqoIUdRr9s6bA3BBSJOcbdA8zJlQX7XQ8KoxsIVZA9LccFEVhPcm3wvF utybZzjn8ann2WNDsfmFHdZMAj1/6zuCSj/FUz6/UTjCmT96EdclVnUlWRtx1+kfkk GB1tvijuRJqmQ3fAvSIVhf1RnF8uYNtqAVn62BFkoj3hP8GOZGsWTquek9+wbyrJcx OUvJa5IOw6JnONjdLUjJlQzHE4LAQ+f7x05z3Pla76nPdqbOdp3AKitnHlzRb/NH0x XyM/0RM1qMQqadTG+4E9P9wm86DnYH3qW9sfLbdALZAA3R7MOobvx0s781NqQKeVXp IX8unnAbhtfrQ== 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 11/36] iio: dac: ds4424: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:54 +0100 Message-Id: <20220621202719.13644-12-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: Ismail H. Kose --- drivers/iio/dac/ds4424.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/dac/ds4424.c b/drivers/iio/dac/ds4424.c index 5a5e967b0be4..509394690bcc 100644 --- a/drivers/iio/dac/ds4424.c +++ b/drivers/iio/dac/ds4424.c @@ -171,7 +171,7 @@ static int ds4424_verify_chip(struct iio_dev *indio_dev) return ret; } -static int __maybe_unused ds4424_suspend(struct device *dev) +static int ds4424_suspend(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct iio_dev *indio_dev = i2c_get_clientdata(client); @@ -189,7 +189,7 @@ static int __maybe_unused ds4424_suspend(struct device *dev) return ret; } -static int __maybe_unused ds4424_resume(struct device *dev) +static int ds4424_resume(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct iio_dev *indio_dev = i2c_get_clientdata(client); @@ -206,7 +206,7 @@ static int __maybe_unused ds4424_resume(struct device *dev) return ret; } -static SIMPLE_DEV_PM_OPS(ds4424_pm_ops, ds4424_suspend, ds4424_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ds4424_pm_ops, ds4424_suspend, ds4424_resume); static const struct iio_info ds4424_info = { .read_raw = ds4424_read_raw, @@ -312,7 +312,7 @@ static struct i2c_driver ds4424_driver = { .driver = { .name = "ds4424", .of_match_table = ds4424_of_match, - .pm = &ds4424_pm_ops, + .pm = pm_sleep_ptr(&ds4424_pm_ops), }, .probe = ds4424_probe, .remove = ds4424_remove,