From patchwork Tue Oct 10 07:51:02 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: 13414952 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 51819CD68F8 for ; Tue, 10 Oct 2023 07:51:51 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XasUQw+scoAMt6BaYz75B8x2Oml93/6tEJbUrpEwO0o=; b=vQKDNcaQN2ZMiZ VDPyvFo5f2UkNufCQTbpJybwfIZcZlEDKnIFxY64TadBqygW5iPJc5C1UBL5q/VdNmgWo8t30wjHu kpTzOcpJ44VE5HvDMo9tSXZVTDpFLc4Gdn5/7OSk2avGrAkfwejeSOsX7n0wliFqYltRvNom5iQSa QxoFwOroAK9sK8g8vpIDX/1oAd/pQTAGFYIAdOhlr1R+np66DAXO1PvLsHsSejLVx2L0bSRIxxeV1 9MFN1Mf411LFmJbntni4XijmhzzkE0OOKTTuCtoJ4skicyF6PzTWJVfA1wvOqsY0WGMmXZJihswTn gGSFKpUG6/PuLHTPJPBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qq7WY-00CkUQ-2H; Tue, 10 Oct 2023 07:51:26 +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 1qq7WU-00CkRT-0P for linux-arm-kernel@lists.infradead.org; Tue, 10 Oct 2023 07:51:24 +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 1qq7WP-00085w-3D; Tue, 10 Oct 2023 09:51:17 +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 1qq7WO-000bij-D6; Tue, 10 Oct 2023 09:51:16 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qq7WO-00CvmT-3j; Tue, 10 Oct 2023 09:51:16 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding Subject: [PATCH 01/11] pwm: atmel-hlcdc: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Tue, 10 Oct 2023 09:51:02 +0200 Message-Id: <20231010075112.755178-2-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=1713; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=C4+umzVxT2rhBws90sGSAPmmXJWOYZzV3E3d1iM1tTE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlJQJdwNkD9AMb8h1TC1gu+ZrmsYpEiuwEXqh9v H/K2AFahRaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSUCXQAKCRCPgPtYfRL+ TixFB/4lnF/5hqEn9S3Evs6U8C0xcsfz6ni6ffDR2wLn4rfdDZUcP9bqwPI6y9qSDqRPEv7cYUC Hp8OrgOPWmMUEVBDHD3Ujb/+Myu0ylE+GlaUB9MrfkXyZAfZaSM8z9l7jTITGaR7rfH7pTfy61b LA/qRvx0PiUyU6irtUn9F6YScW3VSI7Wgfcvjhjn3tOY6DQt1Vetm3SG1UHth5FlM5fuVcS4RFl tv6EqdH5b1D01YyqnRAEiyHgIBWyF6URUHdbmdnJvmBgW10hDuQu74vZRCQ2JZac9Q2W1gJHkg4 4WSmwPh3H0VaPA3ZDBUnaKOmYKuDmi78hTXY21WfKoRL6zdj 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_005122_163102_2F8F7182 X-CRM114-Status: GOOD ( 14.86 ) 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: , Cc: linux-pwm@vger.kernel.org, Alexandre Belloni , Florian Fainelli , Claudiu Beznea , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org 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 #ifdef 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-atmel-hlcdc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-atmel-hlcdc.c b/drivers/pwm/pwm-atmel-hlcdc.c index e271d920151e..95a806c7f623 100644 --- a/drivers/pwm/pwm-atmel-hlcdc.c +++ b/drivers/pwm/pwm-atmel-hlcdc.c @@ -181,7 +181,6 @@ static const struct atmel_hlcdc_pwm_errata atmel_hlcdc_pwm_sama5d3_errata = { .div1_clk_erratum = true, }; -#ifdef CONFIG_PM_SLEEP static int atmel_hlcdc_pwm_suspend(struct device *dev) { struct atmel_hlcdc_pwm *atmel = dev_get_drvdata(dev); @@ -211,10 +210,9 @@ static int atmel_hlcdc_pwm_resume(struct device *dev) return atmel_hlcdc_pwm_apply(&atmel->chip, &atmel->chip.pwms[0], &state); } -#endif -static SIMPLE_DEV_PM_OPS(atmel_hlcdc_pwm_pm_ops, - atmel_hlcdc_pwm_suspend, atmel_hlcdc_pwm_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(atmel_hlcdc_pwm_pm_ops, + atmel_hlcdc_pwm_suspend, atmel_hlcdc_pwm_resume); static const struct of_device_id atmel_hlcdc_dt_ids[] = { { @@ -298,7 +296,7 @@ static struct platform_driver atmel_hlcdc_pwm_driver = { .driver = { .name = "atmel-hlcdc-pwm", .of_match_table = atmel_hlcdc_pwm_dt_ids, - .pm = &atmel_hlcdc_pwm_pm_ops, + .pm = pm_ptr(&atmel_hlcdc_pwm_pm_ops), }, .probe = atmel_hlcdc_pwm_probe, .remove_new = atmel_hlcdc_pwm_remove, From patchwork Tue Oct 10 07:51:03 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: 13414956 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 29BD1CD68F9 for ; Tue, 10 Oct 2023 07:51:58 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tAM7BaauuDWsl4cnNx+uoq/fheIy4TiVA1nqFzqlNn8=; b=2CJevyXjBz0oDu 8FqVbbLGNFtzzPHfwbyGcITAaph9/NKhVEWWczg+yC3jBbb1ix5u2nsfY6YTGXFF4v7AUEHSW8juC dqhEQpEzVQAZ9JbwMxG0NmQKbjsDH+KKhYWs6/+Rlb7cJxCCNRNqyN2Pzpzq7q1VUttZMhS2xBWo0 gEebpO//4BMBlKi3BGERqRefgjPqiAsb4K2klWVmMzpq9J20J84kQeurF+0O1yJf/B5jcvvxDzeTR htn8AfjcJdCwYbBAfjVzal15KAm3+XUqT5jZqIMSJ7uHaMnuoSK9xgYry89KxeQozjBA+BeykpK46 OahJnL1I2afsrWD2yRcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qq7Wg-00CkYG-08; Tue, 10 Oct 2023 07:51:34 +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 1qq7WU-00CkRU-0W for linux-arm-kernel@lists.infradead.org; Tue, 10 Oct 2023 07:51:26 +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 1qq7WP-00085x-3D; Tue, 10 Oct 2023 09:51:17 +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 1qq7WO-000bim-LM; Tue, 10 Oct 2023 09:51:16 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qq7WO-00CvmX-C5; Tue, 10 Oct 2023 09:51:16 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding Subject: [PATCH 02/11] pwm: atmel-tcb: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Tue, 10 Oct 2023 09:51:03 +0200 Message-Id: <20231010075112.755178-3-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=1524; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SzKV8jKaqvT8DZF/BhY4vmdm5P9Q1JiMpCdaCBw5ojA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlJQJe5FTbag4f5B7svF9UTB2Hc84AmwjYaWqpw mAwd40vEWSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSUCXgAKCRCPgPtYfRL+ Tky7B/wPWfRL7TLQmx9YR6/v5t7lS39zuxyN+EQ4CSS1PKxNyf+wtjUU0J3vLmIYl2xBRIlfuWJ e8512+IUfIYk7epdXCgr1H3kyMu4zKz+IhrxIeooF57McJ4Y6+PMVEsbWRuW11gWOfxEIftX5FC EImXKj6Ivk+W4b3XrVhWCONd7ZbdGDrN2g+g1KDLa6D8+jPFi8XvezuQIasnUungDCjZvMY3Ude NPO2b4mcMkKZif691eIYn5wMCO02qbRujGL0J5SJXr96cna2FdT4aY7MD1hUqHBSIN9/GlEvKBh fa7Qpl8ee8rNzVTKgHgeTMA5xk0Rj3HsoQX5YTQ+xhfgLOrq 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_005122_194028_57B15BDD X-CRM114-Status: GOOD ( 14.72 ) 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: , Cc: linux-pwm@vger.kernel.org, Alexandre Belloni , Florian Fainelli , Claudiu Beznea , kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org 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 #ifdef 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-atmel-tcb.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c index c00dd37c5fbd..a2be4cb4c073 100644 --- a/drivers/pwm/pwm-atmel-tcb.c +++ b/drivers/pwm/pwm-atmel-tcb.c @@ -490,7 +490,6 @@ static const struct of_device_id atmel_tcb_pwm_dt_ids[] = { }; MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids); -#ifdef CONFIG_PM_SLEEP static int atmel_tcb_pwm_suspend(struct device *dev) { struct atmel_tcb_pwm_chip *tcbpwm = dev_get_drvdata(dev); @@ -523,16 +522,15 @@ static int atmel_tcb_pwm_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend, - atmel_tcb_pwm_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(atmel_tcb_pwm_pm_ops, atmel_tcb_pwm_suspend, + atmel_tcb_pwm_resume); static struct platform_driver atmel_tcb_pwm_driver = { .driver = { .name = "atmel-tcb-pwm", .of_match_table = atmel_tcb_pwm_dt_ids, - .pm = &atmel_tcb_pwm_pm_ops, + .pm = pm_ptr(&atmel_tcb_pwm_pm_ops), }, .probe = atmel_tcb_pwm_probe, .remove_new = atmel_tcb_pwm_remove, From patchwork Tue Oct 10 07:51:05 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: 13414959 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 7EE8DCD68F9 for ; Tue, 10 Oct 2023 07:52:04 +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=3+ZvPOFSiF9LKV32K2n5FWqFyiBVoCSyvaFiFSavo4w=; b=c66MpwvhC9gXvn sRMp9dn+Z+MFiPMn+s1ueL+i+RymwUluq9Fm92Xl+Xajm94xix5uGIdbbg9NKpg+jZJgT+v+j6fk9 7D+/UCKlmquqmX8jnVQLx1wTjDLPjwLQe5Vx2wJ6NIS4LD9eFuyuP8ntF8YwHLzSaQENcjpFw7XOP 0vhpKX8OM/vjHcZJA4MuIs+BwFMyXOuMxrFX7f65ob3i/dw4poKWPw0Uu7afR3ZqBzC/WJMR5e3F7 nYHcAQ16r2ARR+A30g4qSRzYEIpEkJ+DuBVRiO1FIBA2emqLEEGeyxWEV+tII/QJc2MnKZR85lumv gQ37OeDaSMMjiiDOXoZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qq7WZ-00CkUg-0u; Tue, 10 Oct 2023 07:51:27 +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 1qq7WT-00CkQw-1S for linux-arm-kernel@lists.infradead.org; Tue, 10 Oct 2023 07:51:24 +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 1qq7WP-00086M-Fh; Tue, 10 Oct 2023 09:51:17 +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-000bis-2U; 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 1qq7WO-00Cvmk-PZ; Tue, 10 Oct 2023 09:51:16 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding Cc: Florian Fainelli , Broadcom internal kernel review list , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 04/11] pwm: brcmstb: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Tue, 10 Oct 2023 09:51:05 +0200 Message-Id: <20231010075112.755178-5-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=1661; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iYDXGJGWUBfWT5vIf3vehYDyoPsCipPyumwrYXWQO9M=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlJQJgcooHDNye5hATcAWTtUKkL4ka/8nDh+ouw 5harhtzpluJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSUCYAAKCRCPgPtYfRL+ ThWvB/9rrJ8MJwwDRqE4K4KhSKvEyJnSgPONSjPKgbPZ8P56q6RqpLQUStU6TVBPWz4r+i13U8+ 2yMcXfU++li+Pg0xAxKYy4M8I+i096XcwVBGX7vLN3MvZ6boITgCOogJvkGOuxsIW+mf8VXAZuw xXjrC0Mk2r614tPJs2sBREa9lxfijxizTQpL9wKkuw0IkliKpXU6zju8iWwwq8S5HKXe2pq7Q9e peaN5YKREpdGeSL932TqulyMvVJbetl7xlbJ0OpYK23Mikhtr2krSIL8u8m9bHLCkLw42SFS2kC nmjCUf0wcQuuE2ZjYPPpKFS4n+cTPcUl4JfmDz69++4ZqoeI 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_005121_490124_55C21780 X-CRM114-Status: GOOD ( 15.69 ) 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 #ifdef 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 Acked-by: Florian Fainelli --- drivers/pwm/pwm-brcmstb.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/pwm/pwm-brcmstb.c b/drivers/pwm/pwm-brcmstb.c index a3faa9a3de7c..7510b85dd9dd 100644 --- a/drivers/pwm/pwm-brcmstb.c +++ b/drivers/pwm/pwm-brcmstb.c @@ -283,7 +283,6 @@ static void brcmstb_pwm_remove(struct platform_device *pdev) clk_disable_unprepare(p->clk); } -#ifdef CONFIG_PM_SLEEP static int brcmstb_pwm_suspend(struct device *dev) { struct brcmstb_pwm *p = dev_get_drvdata(dev); @@ -297,14 +296,11 @@ static int brcmstb_pwm_resume(struct device *dev) { struct brcmstb_pwm *p = dev_get_drvdata(dev); - clk_enable(p->clk); - - return 0; + return clk_enable(p->clk); } -#endif -static SIMPLE_DEV_PM_OPS(brcmstb_pwm_pm_ops, brcmstb_pwm_suspend, - brcmstb_pwm_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(brcmstb_pwm_pm_ops, brcmstb_pwm_suspend, + brcmstb_pwm_resume); static struct platform_driver brcmstb_pwm_driver = { .probe = brcmstb_pwm_probe, @@ -312,7 +308,7 @@ static struct platform_driver brcmstb_pwm_driver = { .driver = { .name = "pwm-brcmstb", .of_match_table = brcmstb_pwm_of_match, - .pm = &brcmstb_pwm_pm_ops, + .pm = pm_ptr(&brcmstb_pwm_pm_ops), }, }; module_platform_driver(brcmstb_pwm_driver); From patchwork Tue Oct 10 07:51:07 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: 13414954 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 A51D4CD68F8 for ; Tue, 10 Oct 2023 07:51:57 +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=Pr4bplcknPNIpZfBEOX76VKXuabPBk4RITZ0U1LUlYk=; b=uoL8OZjImMj0Ym jZMz4XIM1iELJdtELCQjgOj9HrItgrfm4/x+cT2EM+BEyRXECkzTyOEvbsosV+ZfcfoY6x6lxkBQC FhPgi62nB9tuybEDh4AHfeMeyrAR8Y1Z0I77ZnhRCyJKKA80L/m1zhHBd0LAy+Z2ZcxeoO3EWOwTL JPDkzlu3xoaIjVAjjyVA1xjEZBN6ajh6Zsve9EC13MF0cxLPW+6sU2LI/iDrSh0+hSBIOicY6WAqO 1WRq5mYPu9Fl0wFXXWFZLGM6/z6LHAD+2K1n+MC0/NG5XXlnJrth4A0APlhf1LW5OSXwndvRR//HG Mai0+HGpI4Hcrrk1etRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qq7We-00CkXO-3C; Tue, 10 Oct 2023 07:51:32 +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-00CkSK-0L for linux-arm-kernel@lists.infradead.org; Tue, 10 Oct 2023 07:51:26 +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 1qq7WP-00086l-UT; Tue, 10 Oct 2023 09:51:17 +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-000bj1-GX; 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-00Cvms-7H; Tue, 10 Oct 2023 09:51:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding Cc: Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, Florian Fainelli Subject: [PATCH 06/11] pwm: imx-tpm: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Tue, 10 Oct 2023 09:51:07 +0200 Message-Id: <20231010075112.755178-7-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=1936; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=G63sXWp1uiBNn/DBIlnt1enYAQXeqGMDNyswG5BF2RI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlJQJimPi7RUjt8eOzKBzv+gWTAKJ8E5IoqdUzd 5BLYv5R9K2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSUCYgAKCRCPgPtYfRL+ TuVpCAC5A7YTHW6fWGzymID5WHsQ6e0xL4/LF+o+kccuuVrxkuLy/jZYdvgRjxvVdDeGmY42L+/ sKwU9bhkmA2wdOM3YbbRKe/WMToGE1q516oOR/UHC0ojXTz4eumN31ozyhYTeJyOmhgL5LzjgVe G+b+AecZHGQh0DncCLEtWbhB+dxLRsCuNqADMjieAF91BS3OfmdL1jveW77ONm//lifQB4DsduX qldQVUsxjBSllG3/8x3Qzzb8I0+vOnM9XI82r1BXbqo75SAlvRdkVP5tAqMFGaI3UafAZKKhDKT MYg05ElaQnUwbfrNUx3y1HG38e7vQc7B2nhNPOluyOe9ITvF 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_142043_11E59526 X-CRM114-Status: GOOD ( 15.86 ) 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-imx-tpm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-imx-tpm.c b/drivers/pwm/pwm-imx-tpm.c index 98ab65c89685..da22f9bb367e 100644 --- a/drivers/pwm/pwm-imx-tpm.c +++ b/drivers/pwm/pwm-imx-tpm.c @@ -390,7 +390,7 @@ static void pwm_imx_tpm_remove(struct platform_device *pdev) clk_disable_unprepare(tpm->clk); } -static int __maybe_unused pwm_imx_tpm_suspend(struct device *dev) +static int pwm_imx_tpm_suspend(struct device *dev) { struct imx_tpm_pwm_chip *tpm = dev_get_drvdata(dev); @@ -409,7 +409,7 @@ static int __maybe_unused pwm_imx_tpm_suspend(struct device *dev) return 0; } -static int __maybe_unused pwm_imx_tpm_resume(struct device *dev) +static int pwm_imx_tpm_resume(struct device *dev) { struct imx_tpm_pwm_chip *tpm = dev_get_drvdata(dev); int ret = 0; @@ -421,8 +421,8 @@ static int __maybe_unused pwm_imx_tpm_resume(struct device *dev) return ret; } -static SIMPLE_DEV_PM_OPS(imx_tpm_pwm_pm, - pwm_imx_tpm_suspend, pwm_imx_tpm_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(imx_tpm_pwm_pm, + pwm_imx_tpm_suspend, pwm_imx_tpm_resume); static const struct of_device_id imx_tpm_pwm_dt_ids[] = { { .compatible = "fsl,imx7ulp-pwm", }, @@ -434,7 +434,7 @@ static struct platform_driver imx_tpm_pwm_driver = { .driver = { .name = "imx7ulp-tpm-pwm", .of_match_table = imx_tpm_pwm_dt_ids, - .pm = &imx_tpm_pwm_pm, + .pm = pm_ptr(&imx_tpm_pwm_pm), }, .probe = pwm_imx_tpm_probe, .remove_new = pwm_imx_tpm_remove, From patchwork Tue Oct 10 07:51:08 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: 13414953 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 B5078CD68F6 for ; Tue, 10 Oct 2023 07:51:57 +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=moA45FkUO35aFnqVSXSlkfq+pUytn46Xk5NFu23B8rE=; b=j5yEmeKQHL88K9 P1gMwYt1+wicGKAAjV9hjmfcOSnACAYeqIYS7A6T73E3htuHZNQOc9U7vHidHi4u5HTj0taevcmrl rEKM+5i72otz2sAWCO5bOChcu/7KI5A80tQYeovIElEh1r94J93YqkF1cTVAMqwk3GRkcESNTPyGX QWz+Ofsz1awV6kopLbDh8Z91+r1ZJxzrnvRkgbPiArqAN9vlpkbxOJc8gh7kd5195qdTLo+4Im2Wh kGf1dbRXtAKB/kyMlQyl+32f8MXsBsBFr+qhCxt1fkaCwm8Krup9TzpljvXykr2i8n8n+ZKjzoYoM qXB4bO+4RYj+SIYP5nXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qq7Wf-00CkXo-1d; Tue, 10 Oct 2023 07:51:33 +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 1qq7WU-00CkRn-1J for linux-arm-kernel@lists.infradead.org; Tue, 10 Oct 2023 07:51:26 +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 1qq7WS-000879-DV; Tue, 10 Oct 2023 09:51:20 +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-000bj5-Nu; 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-00Cvmw-EV; Tue, 10 Oct 2023 09:51:17 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding Cc: Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-pwm@vger.kernel.org, kernel@pengutronix.de, Florian Fainelli Subject: [PATCH 07/11] pwm: samsung: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Tue, 10 Oct 2023 09:51:08 +0200 Message-Id: <20231010075112.755178-8-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=1412; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=tdDsVaIQTBAFmDdZwZMSBACIYYvrBNNMW6Ee1DHfp08=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlRVppSXmwwz+3dzfLohPFdivnHpxXfiFspG87/w6ar1X vd/eCC3k9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJREaz//eXvDM3o9O6Y47l tOd2ZyLyo6oPROfGha4zXXzoA2tPCtvy7RenL/N1V3PVe9+qt0Ah1OpZ1bSdU5t67m07v+ouh6X w+j+nzgiqnGrgditTKtuaX6YbIl2Yf/ThQsWj8t9DYwQZgrRuJNhvS/ZYXPrzc7ir/B5hzYsrMp h3nN4Z1B2i7JglvfRBv5NZyIsvUlZv+6skT3Q3J1clxc4PMemJmWZb38x09YVhmrPjMr0CCbP2J +GVvWKKfG9/SUlxsHrHfzo28y3bbLst1ZOkhfReWyoxdhenqcdOTTHNvuhbkZRpm5jEqCFcM7Mu /8yCGWeKFzO2ZTU9e71IdUGU7eJ91zNzfCXmRZ5UuQ0A 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_005122_438254_673E9B28 X-CRM114-Status: GOOD ( 14.43 ) 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 #ifdef 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-samsung.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index e8828f57ab15..041e2f9476ff 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c @@ -630,7 +630,6 @@ static void pwm_samsung_remove(struct platform_device *pdev) clk_disable_unprepare(chip->base_clk); } -#ifdef CONFIG_PM_SLEEP static int pwm_samsung_resume(struct device *dev) { struct samsung_pwm_chip *our_chip = dev_get_drvdata(dev); @@ -663,14 +662,13 @@ static int pwm_samsung_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(pwm_samsung_pm_ops, NULL, pwm_samsung_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(pwm_samsung_pm_ops, NULL, pwm_samsung_resume); static struct platform_driver pwm_samsung_driver = { .driver = { .name = "samsung-pwm", - .pm = &pwm_samsung_pm_ops, + .pm = pm_ptr(&pwm_samsung_pm_ops), .of_match_table = of_match_ptr(samsung_pwm_matches), }, .probe = pwm_samsung_probe, 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); From patchwork Tue Oct 10 07:51:10 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: 13414957 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 CFB4CCD68F8 for ; Tue, 10 Oct 2023 07:52:00 +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=FdvR+7pEpjsHQP6k+37zdzX6c48yfSFQFUPjWfGayrA=; b=MA1/5ALzr8GQTC grciXzpeNpfdJu/ehzCSyGL9aWV4Zm7GtTeFXDK1uvMZO0ve6kk90tpHuwL8H4wMS8rNKsawvFg4v 8QStVeSAPV2wUCyzlicnmkUBqgtCDJ5w1DoB4R9mQqo/E9L0H8J9jAEHI+oL9fdXnR+7vUnKdgkhc 8o57R4fyVn4OON0cOBm+rFcErrhjoHx3IYQKcrMpun73k8oYvmlvhDsIkXvakJi9PeQHD5UOZu4Gp 6tUBGr2IkJXS/P1Oz02mXM9n974CYj4h6nYheGVM7WI14iOsy322bVa205WX8ztEd5n5EyKioGydR 3U2X/765CEw7ZEraXt+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qq7Wg-00CkZ2-2K; Tue, 10 Oct 2023 07:51:34 +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-00CkSY-0n for linux-arm-kernel@lists.infradead.org; Tue, 10 Oct 2023 07:51:26 +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-00087P-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 1qq7WQ-000bjD-4I; Tue, 10 Oct 2023 09:51:18 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qq7WP-00Cvn3-RF; 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 09/11] pwm: stm32: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Tue, 10 Oct 2023 09:51:10 +0200 Message-Id: <20231010075112.755178-10-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=1905; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=J3d8GcPNU2JxszGotBSV8ACakmJafzp5yz5XcHiQaD0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlJQJm44pduhUOh3aCddSM3B/P4UVVaobbygE6l PzBHz6cq3mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSUCZgAKCRCPgPtYfRL+ Ttx5B/49/KWR8RJARvVqld2wmoZpAKyXjgurfzNnviwVQFJQM+/rLjfSK0agiFekdEWjBpVSafI lFTXT1N8uZyDciIu+oQJuaeyfSWBvIruNaaWMw3cr/WHagipYYcApQG3rLg3p1hcd/6U+m0p5/l 95aiQVEhxDs0ABlwM4qh5NAflNSTzdkNT4MgeHAdQZZsN0UTs4gGKXrlSocIlyVOMk5UQlrKr5h H9mRdqdIp7lbr09q4O0uNITV/yY2abY3g8VRHAeMJ7FkGFtT7TcnK7pc6703kZAUIybpoPlsO/T G1X7NCDPAVzkiwIUt+68oOjW60G5vkwQV8qI2Kvs4/B5m1+a 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_284444_408A59D1 X-CRM114-Status: GOOD ( 15.03 ) 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.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c index 3d6be7749e23..a9c7b5b6ab23 100644 --- a/drivers/pwm/pwm-stm32.c +++ b/drivers/pwm/pwm-stm32.c @@ -646,7 +646,7 @@ static int stm32_pwm_probe(struct platform_device *pdev) return 0; } -static int __maybe_unused stm32_pwm_suspend(struct device *dev) +static int stm32_pwm_suspend(struct device *dev) { struct stm32_pwm *priv = dev_get_drvdata(dev); unsigned int i; @@ -667,7 +667,7 @@ static int __maybe_unused stm32_pwm_suspend(struct device *dev) return pinctrl_pm_select_sleep_state(dev); } -static int __maybe_unused stm32_pwm_resume(struct device *dev) +static int stm32_pwm_resume(struct device *dev) { struct stm32_pwm *priv = dev_get_drvdata(dev); int ret; @@ -680,7 +680,7 @@ static int __maybe_unused stm32_pwm_resume(struct device *dev) return stm32_pwm_apply_breakinputs(priv); } -static SIMPLE_DEV_PM_OPS(stm32_pwm_pm_ops, stm32_pwm_suspend, stm32_pwm_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stm32_pwm_pm_ops, stm32_pwm_suspend, stm32_pwm_resume); static const struct of_device_id stm32_pwm_of_match[] = { { .compatible = "st,stm32-pwm", }, @@ -693,7 +693,7 @@ static struct platform_driver stm32_pwm_driver = { .driver = { .name = "stm32-pwm", .of_match_table = stm32_pwm_of_match, - .pm = &stm32_pwm_pm_ops, + .pm = pm_ptr(&stm32_pwm_pm_ops), }, }; module_platform_driver(stm32_pwm_driver);