From patchwork Tue Oct 10 07:51:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13414958 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6C7CCD68F6 for ; Tue, 10 Oct 2023 07:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JLkeizaW1NaNkvXuNCtclepV3njKWyRECItokXQOTIs=; b=P+zTtn9kVJW1CM BbSfrkihNe5gaDC25zBV6N5gXRckZO+s9Q4Eezioc4RLOyFgmLfwoDufsq0tyfnMJWbRBX363EIZk 4Inw9TpFlNqVij5+PjaRmbYPAhpMb3rMXxYB6znyYv9Vr28HB46kp+IMLenXiMubVmiHdGOEoZRTS L9wAqAeXKYE6eo5dBm++JvX5Agz+q89DkKBzb0aVM1lY7nTUfi9t19hMVwt5Va3Y/qqAETmeEQirp 0H+d6Td58HgXFL6JLgKJZXy5O1VWxEyLjfIejOK+OI2CfTNtJd2mp1TIN0JMfQkSlaRFP4CyHmJoq jeeBKyu3MEw+iSY+Wb8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qq7Wi-00CkaI-0W; Tue, 10 Oct 2023 07:51:36 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qq7WV-00CkSZ-0u for linux-arm-kernel@lists.infradead.org; Tue, 10 Oct 2023 07:51:27 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qq7WR-00087G-3k; Tue, 10 Oct 2023 09:51:19 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qq7WP-000bj9-U6; Tue, 10 Oct 2023 09:51:17 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qq7WP-00Cvn0-Km; Tue, 10 Oct 2023 09:51:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding Cc: Fabrice Gasnier , Maxime Coquelin , Alexandre Torgue , linux-pwm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, Florian Fainelli Subject: [PATCH 08/11] pwm: stm32-lp: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Tue, 10 Oct 2023 09:51:09 +0200 Message-Id: <20231010075112.755178-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231010075112.755178-1-u.kleine-koenig@pengutronix.de> References: <20231010075112.755178-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1865; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Ie2lp5jK0RCijQw0QeInl/FaAgYLDxQHke+dn88ClU8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlJQJl2mAn/jl4uOMOspFvPR6S+3oYZDPCWeC6L +OuWe3zDvWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSUCZQAKCRCPgPtYfRL+ TvIEB/9ABMEJUE/NOby37gCqrb4KC3z5SDOZIZPoBsVrQXbXcDwwsK+H8/ecRTHXKyHnaNicyVL GCPexNj4ZyC4hkYEdBPEgPZPR1wrQ68gKC49hqL9W/r0sqBwYY2Nv//EHG7DviaEjz5XCQWPPPj oheWF3hZoo5CrK+uQuU1nB4bKu+gjtuTzZVmvtRQPeFvlMuv7sCM7nYc4vjwYYOcPnFI+avhJa7 q+TLTRwmKHqyESxWAT5GkhjWr7Gps3eU73sKJF7UBTkAat7iyKRHnh3bFdpccIqfr1t3YgdP+s0 3T4QK5bdDvVEWbkOxhskn7DT5eeAy+Enj971PGAr5mVe2+HN X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231010_005123_315564_B00D41EB X-CRM114-Status: GOOD ( 15.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This macro has the advantage over SIMPLE_DEV_PM_OPS that we don't have to care about when the functions are actually used, so the corresponding __maybe_unused can be dropped. Also make use of pm_ptr() to discard all PM related stuff if CONFIG_PM isn't enabled. Signed-off-by: Uwe Kleine-König Reviewed-by: Jonathan Cameron --- drivers/pwm/pwm-stm32-lp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c index bb3a045a7334..ac00f9224bda 100644 --- a/drivers/pwm/pwm-stm32-lp.c +++ b/drivers/pwm/pwm-stm32-lp.c @@ -219,7 +219,7 @@ static int stm32_pwm_lp_probe(struct platform_device *pdev) return 0; } -static int __maybe_unused stm32_pwm_lp_suspend(struct device *dev) +static int stm32_pwm_lp_suspend(struct device *dev) { struct stm32_pwm_lp *priv = dev_get_drvdata(dev); struct pwm_state state; @@ -234,13 +234,13 @@ static int __maybe_unused stm32_pwm_lp_suspend(struct device *dev) return pinctrl_pm_select_sleep_state(dev); } -static int __maybe_unused stm32_pwm_lp_resume(struct device *dev) +static int stm32_pwm_lp_resume(struct device *dev) { return pinctrl_pm_select_default_state(dev); } -static SIMPLE_DEV_PM_OPS(stm32_pwm_lp_pm_ops, stm32_pwm_lp_suspend, - stm32_pwm_lp_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stm32_pwm_lp_pm_ops, stm32_pwm_lp_suspend, + stm32_pwm_lp_resume); static const struct of_device_id stm32_pwm_lp_of_match[] = { { .compatible = "st,stm32-pwm-lp", }, @@ -253,7 +253,7 @@ static struct platform_driver stm32_pwm_lp_driver = { .driver = { .name = "stm32-pwm-lp", .of_match_table = stm32_pwm_lp_of_match, - .pm = &stm32_pwm_lp_pm_ops, + .pm = pm_ptr(&stm32_pwm_lp_pm_ops), }, }; module_platform_driver(stm32_pwm_lp_driver);