From patchwork Tue Jun 21 20:26:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889735 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 B03A6C43334 for ; Tue, 21 Jun 2022 20:20:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354129AbiFUUUM (ORCPT ); Tue, 21 Jun 2022 16:20:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354074AbiFUUUJ (ORCPT ); Tue, 21 Jun 2022 16:20:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B977B1D31D for ; Tue, 21 Jun 2022 13:20:08 -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 64B3BB81B07 for ; Tue, 21 Jun 2022 20:20:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2187C341C5; Tue, 21 Jun 2022 20:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842806; bh=9UABDwPS1KiPjY6BZQLOSKM6AFWWDu7EeUkin0n4Lss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Px/QcpumqBdxy2AKqdAvaADSSv+i3hS4oBcSqFoSLbgfpgwczhpbhbvWAPo8GbKNx UWYKtl4OdxjYL3AfVYv+e0bSLi/7kJhH8tUH2jSPHUrRo7Jdqgelg4n4zZwGLAZJLE InHpd8g0T6moT6E+tDS/6p0TpuEhggew2a8NtnufS97NwU/0ztT3+DV7+2fy7naXH0 FE94ph6RG8EZqIZ/uOCesCecFv9lkg4vicy/1asDgOS23gegt9rSPn0oqz9uEDa2rb 45U0xl3uFTNTY3pxqnzetPyF8eaxAHScHzW5Liy1R+r5HHtTW/P40ZV3/kT2lQWUJ6 L2UEyXVspygaA== 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 15/36] iio: dac: mcp4725: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:26:58 +0100 Message-Id: <20220621202719.13644-16-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: Philippe Reynes --- drivers/iio/dac/mcp4725.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c index 7fcb86288823..bb4b85a7b95b 100644 --- a/drivers/iio/dac/mcp4725.c +++ b/drivers/iio/dac/mcp4725.c @@ -42,7 +42,7 @@ struct mcp4725_data { struct regulator *vref_reg; }; -static int __maybe_unused mcp4725_suspend(struct device *dev) +static int mcp4725_suspend(struct device *dev) { struct mcp4725_data *data = iio_priv(i2c_get_clientdata( to_i2c_client(dev))); @@ -55,7 +55,7 @@ static int __maybe_unused mcp4725_suspend(struct device *dev) return i2c_master_send(data->client, outbuf, 2); } -static int __maybe_unused mcp4725_resume(struct device *dev) +static int mcp4725_resume(struct device *dev) { struct mcp4725_data *data = iio_priv(i2c_get_clientdata( to_i2c_client(dev))); @@ -68,7 +68,8 @@ static int __maybe_unused mcp4725_resume(struct device *dev) return i2c_master_send(data->client, outbuf, 2); } -static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, mcp4725_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, + mcp4725_resume); static ssize_t mcp4725_store_eeprom(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) @@ -523,7 +524,7 @@ static struct i2c_driver mcp4725_driver = { .driver = { .name = MCP4725_DRV_NAME, .of_match_table = mcp4725_of_match, - .pm = &mcp4725_pm_ops, + .pm = pm_sleep_ptr(&mcp4725_pm_ops), }, .probe = mcp4725_probe, .remove = mcp4725_remove,