From patchwork Fri Oct 13 17:42: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: 13421534 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 E645ACDB482 for ; Fri, 13 Oct 2023 17:43:12 +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=y6/cRfoqh6LFSulWbrXP+pGSPMg+5kr/PLhfY9xsbMA=; b=E/vUTWHEmuznXC hZfb5BTazpBtLvZDyHkRt5jUsdhY+hJsMXZRxZBtORWrO9lBKozPdSFUcMbv8ST0kWLnAaFuVb+L1 dVfDoPA16gvkZDgk8dR4ZN4L78NxuA6PAnAsilEaKhBmMn5nb1LaPieKpMwqG7LaIxvdmZyl4kIhh H8VxzFlJAAqiiP0/YMzX+OncK94YIuY6RVLIDPMBrIfw+z3Y2YD4OwlNJuFKQrooCEInJftORGNOV Sephs44I3aicLiBoFRWcIXZLdIwYQfF3NHmiPhh8YDbSPBiGyWsc0tvIxjH1ER9Ou+hAShPFcZnIC yOdq9X0VkhKy3+mqLzXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qrMBP-003zCj-2i; Fri, 13 Oct 2023 17:42:43 +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 1qrMBF-003z83-2H for linux-arm-kernel@lists.infradead.org; Fri, 13 Oct 2023 17:42:36 +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 1qrMB9-0004VH-Va; Fri, 13 Oct 2023 19:42:27 +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 1qrMB7-001RgW-Lx; Fri, 13 Oct 2023 19:42:25 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qrMB7-00Filb-CT; Fri, 13 Oct 2023 19:42:25 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding Subject: [PATCH v2 02/11] pwm: atmel-tcb: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Date: Fri, 13 Oct 2023 19:42:07 +0200 Message-ID: <20231013174204.1457085-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231013174204.1457085-13-u.kleine-koenig@pengutronix.de> References: <20231013174204.1457085-13-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1561; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=s/RV24x+4N1RGFR3t5c6VN7LdTx9o4dgt4gZk2Ko4IU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlKYFvOfYkPZlP+Jfegu7rqc8ZRLcQf0EnuKpZJ 4l4FAa640SJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSmBbwAKCRCPgPtYfRL+ TnbYCACScNJ+1b9T5NGFT33n31DvEdNEquTWmRA211f/+zzTcWhmRKkRjFIr3LNbWTq/79SiTp/ /ghOSo+jKa95GjW9deoJse54lXmbCk6A8gB3luKL9FMbdd9RO8dybQf0pzZW4lvy4tJvUmiJIzy G5kFtaZuDXqq5/4VwNeR0RvF4p3JZ/5B1CfpUZW6z8LG/fRZX/15xblot4BP3q5QyrBQuR4EQY+ eoKC57BTL0R0GYru4dLAqinKg79j0jMb+O/T29B3GjeW/7bTVwm230OenBrZitG05enbVBx+tzX QUHrIJBNxyqs6sYVmnbBlxJmJcB7EgCjx36rahZvBqpm7Yl1 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-20231013_104233_746123_F5728EAC X-CRM114-Status: GOOD ( 14.62 ) 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 , Claudiu Beznea , kernel@pengutronix.de, Jonathan Cameron , 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 Also make use of pm_ptr() to discard all PM related stuff if CONFIG_PM isn't enabled. Reviewed-by: Jonathan Cameron Signed-off-by: Uwe Kleine-König --- 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 98b33c016c3c..d42c897cb85e 100644 --- a/drivers/pwm/pwm-atmel-tcb.c +++ b/drivers/pwm/pwm-atmel-tcb.c @@ -489,7 +489,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); @@ -522,16 +521,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,