From patchwork Tue Jun 21 20:27:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12889744 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 6F575C433EF for ; Tue, 21 Jun 2022 20:21:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354279AbiFUUVX (ORCPT ); Tue, 21 Jun 2022 16:21:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354270AbiFUUVX (ORCPT ); Tue, 21 Jun 2022 16:21:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B0BD1CFCD for ; Tue, 21 Jun 2022 13:21:22 -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 BA3D2B81B24 for ; Tue, 21 Jun 2022 20:21:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9024BC3411C; Tue, 21 Jun 2022 20:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655842879; bh=P3EhNBqqUGGNk++I8lphjCVAqNPW/abwsn/04zhMlfI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XTOZA9b0q48rRnxp9CyHYGKS5hjPa3pd829167BS9FVi1cUU+0ODS9Q9gOw1ao3dC cFAbNYI7rQz4iYQgeAPG+QwpdB1tTzr0zIswkdy0vHlzF1AxyESXgBuMKfcd1KTnSp TG3Vnzvn7C+mjYOZYvtgWYcrHmRN05H9BiqF8erUG2BMQf9ITcilS5BYqy7Fy7l1LG v4riPUFl3RfslSZN5mYiNsfebKuGrK8j48ArgP0InD48rFLz8sWihdFdsAhDLWfs8J mMS1t7QbckVcrWkQKvl+M1/wLcB1D1FsWJKPkII+ea4bcqnUQYBe/8KkGT2nvZR0d5 GWV9BwL6/Iwtg== 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 24/36] iio: proximity: cros_ec_mkbp: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() Date: Tue, 21 Jun 2022 21:27:07 +0100 Message-Id: <20220621202719.13644-25-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: Enric Balletbo i Serra Cc: Gwendal Grignou Cc: Stephen Boyd Reviewed-by: Gwendal Grignou --- drivers/iio/proximity/cros_ec_mkbp_proximity.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iio/proximity/cros_ec_mkbp_proximity.c b/drivers/iio/proximity/cros_ec_mkbp_proximity.c index 8213b0081713..571ea1812246 100644 --- a/drivers/iio/proximity/cros_ec_mkbp_proximity.c +++ b/drivers/iio/proximity/cros_ec_mkbp_proximity.c @@ -184,7 +184,7 @@ static const struct iio_info cros_ec_mkbp_proximity_info = { .write_event_config = cros_ec_mkbp_proximity_write_event_config, }; -static __maybe_unused int cros_ec_mkbp_proximity_resume(struct device *dev) +static int cros_ec_mkbp_proximity_resume(struct device *dev) { struct cros_ec_mkbp_proximity_data *data = dev_get_drvdata(dev); struct cros_ec_device *ec = data->ec; @@ -201,8 +201,8 @@ static __maybe_unused int cros_ec_mkbp_proximity_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(cros_ec_mkbp_proximity_pm_ops, NULL, - cros_ec_mkbp_proximity_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(cros_ec_mkbp_proximity_pm_ops, NULL, + cros_ec_mkbp_proximity_resume); static int cros_ec_mkbp_proximity_probe(struct platform_device *pdev) { @@ -260,7 +260,7 @@ static struct platform_driver cros_ec_mkbp_proximity_driver = { .driver = { .name = "cros-ec-mkbp-proximity", .of_match_table = cros_ec_mkbp_proximity_of_match, - .pm = &cros_ec_mkbp_proximity_pm_ops, + .pm = pm_sleep_ptr(&cros_ec_mkbp_proximity_pm_ops), }, .probe = cros_ec_mkbp_proximity_probe, .remove = cros_ec_mkbp_proximity_remove,