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,