From patchwork Thu Nov 16 11:26:36 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: 744556 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 D6FF3C197A0 for ; Thu, 16 Nov 2023 11:27:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230473AbjKPL1C (ORCPT ); Thu, 16 Nov 2023 06:27:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230399AbjKPL07 (ORCPT ); Thu, 16 Nov 2023 06:26:59 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00AC6187 for ; Thu, 16 Nov 2023 03:26:55 -0800 (PST) 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 1r3aWH-00084D-AH; Thu, 16 Nov 2023 12:26:49 +0100 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 1r3aWG-009RE9-PB; Thu, 16 Nov 2023 12:26:48 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r3aWG-002aLy-G8; Thu, 16 Nov 2023 12:26:48 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano Cc: Zhang Rui , Lukasz Luba , linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 2/2] thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Thu, 16 Nov 2023 12:26:36 +0100 Message-ID: <20231116112633.668826-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231116112633.668826-1-u.kleine-koenig@pengutronix.de> References: <20231116112633.668826-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1841; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=GhV61L6m5250RjClaUhpQ4Ok3kSdHAD+MEd8kv1eWac=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlVfxsDGe6lAm2SmhswY2cjWZPHW5ajdO34W3Uf Kv+prQDSaWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZVX8bAAKCRCPgPtYfRL+ TnCdB/9YsxgNnfWbUb7UCsbX2HAdOY2Yfzz9LNLP1eNaSGSrM0GLE3kQxrg7zMrIPehmoErkHDs 9XYoZiByxH7hVvNKFHJaqNddzvjYKlCU0OZZe67sVdDBzq5yOpmLhAbEFHFrXm24exNVSuJRjjG Df+fILso3vPJl3TcY924K5/t/XnpXA2LJckEdBA/PWEvREucnpsnYFbcVUGDJ2aT7TRploQAa5f VPIHW4vHLSxba5jqFVrHptWosemRr7XFR073svBIEHGdESU19s0m0Izwl7+VFYZRH9cbP9JPYgW +3ERd08m9GEWDOeASyOxedH299LieKW4xNAdpQlGMxOk07Du 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-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.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 --- drivers/thermal/amlogic_thermal.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c index 562f63b7bf27..df7a5ed55385 100644 --- a/drivers/thermal/amlogic_thermal.c +++ b/drivers/thermal/amlogic_thermal.c @@ -296,7 +296,7 @@ static void amlogic_thermal_remove(struct platform_device *pdev) amlogic_thermal_disable(data); } -static int __maybe_unused amlogic_thermal_suspend(struct device *dev) +static int amlogic_thermal_suspend(struct device *dev) { struct amlogic_thermal *data = dev_get_drvdata(dev); @@ -305,20 +305,21 @@ static int __maybe_unused amlogic_thermal_suspend(struct device *dev) return 0; } -static int __maybe_unused amlogic_thermal_resume(struct device *dev) +static int amlogic_thermal_resume(struct device *dev) { struct amlogic_thermal *data = dev_get_drvdata(dev); return amlogic_thermal_enable(data); } -static SIMPLE_DEV_PM_OPS(amlogic_thermal_pm_ops, - amlogic_thermal_suspend, amlogic_thermal_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(amlogic_thermal_pm_ops, + amlogic_thermal_suspend, + amlogic_thermal_resume); static struct platform_driver amlogic_thermal_driver = { .driver = { .name = "amlogic_thermal", - .pm = &amlogic_thermal_pm_ops, + .pm = pm_ptr(&amlogic_thermal_pm_ops), .of_match_table = of_amlogic_thermal_match, }, .probe = amlogic_thermal_probe,