From patchwork Sat Dec 28 23:32:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922556 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 BFD95E7718F for ; Sat, 28 Dec 2024 23:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wOndzP+gvkrgZs0qc02qdGu1OBtOTqc7KPMQjqAeOC0=; b=rLoo1k4FZtMVM4pXcfpPkdcN9m fUbOZjTNuoBdR0UgW4+QdUtIQVfO1mRLI7o7aklkLv+L2Nt4Wu0ly4TDSvrkEy9ZXOdedppY7dGX8 Uuc9TH+uaTPy2K4ALBt4966FuaXyUQNqcyv2tXwEdrin892Y6xjCrvl3YOUe5h0t1eo6f6g5WGm9A AfLYpOzYWdzT3H6/oWPr6niSPE4E5I8miUwQtQpAszJL3OHfeY/z8cbSL7+oaZhNd5PE6/aZMV7ad o195bwe2SaFPwnSpHqPFClbq2GrkF6Z+w1gwt8Lm+vC0O6bDzCuUW5GmzaB0l0U5eoZEk3HGXBZiU I5StGacQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRgL6-00000002aar-3Z5d; Sat, 28 Dec 2024 23:35:24 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRgIj-00000002Zq7-001n; Sat, 28 Dec 2024 23:32:58 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43675b1155bso65612375e9.2; Sat, 28 Dec 2024 15:32:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428775; x=1736033575; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wOndzP+gvkrgZs0qc02qdGu1OBtOTqc7KPMQjqAeOC0=; b=ZxZ3NcB9A/djata+UMCgHc67Q66v99Htbzr4z33CayeaRaf/ilqQPSuwuRe6KJ58s8 Q6IqqMX0dCe4kJ1gSeukXfI+KidC2ZNlps4a2b8gRmdaP6wHs+A45YrexxOdVCiiLqjg IcnsntZAHXWAXcYh0JzERo1z7TKOKJyxuvsheWdu0m+vPf828wQvUNuWeUzLuuK5bkNS ya4sOaBbBNZHGJhc14H1mm/jNKrdmkg1uon+Db+8iS+Q/XimOJIEQ9YPT3YoZKErO0/w O19vB/7aFWKKlakLkrEWNLrn0u7hTkZ4O8eQZn13KRLgh3+ZhOjtKoK/82ddwEScw6tt KtyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428775; x=1736033575; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wOndzP+gvkrgZs0qc02qdGu1OBtOTqc7KPMQjqAeOC0=; b=QEoioi34uGv7mFeG8K2JnyGy+bSctiriXFvmuHjxPAQjYAu/TDee2/ucf6LJzD+P26 o5elVp/xuHplkLZ/YMADpJmLtVEJEmVZHZ/3RJbm18nhi9WfNelARzkciPiq8uiGS7jR kmbfagLUROGiUl5Lqt89T+HB0JGmyE4jovyzdzasdk5geTxfo7bbg//hT96TBUN/yAc9 rzTyGTekjtc2snRwZ5EViVGQMdyuDfShhrrJjA41uzMryyK68pXxqSSlsW/h885k90jq t3mfjFR6pcr7IOJt2ZAtVpaJFZDXUnvhaGWmPEoZRDXHlP+YJswZEJcc8HuwjNouZZS8 dJPQ== X-Forwarded-Encrypted: i=1; AJvYcCV/y2/jt6/R+A1V4KE4Ezm+RUNAlbIFTAgwnsmUR9BwbIwBfmoXrFf8lRi83cLCM2Ykk1z304Whmvk=@lists.infradead.org X-Gm-Message-State: AOJu0Yw5DltjmHG9eqPEwfEqcwTlQMzO/kvg2vsLwM9EcuUFv18xEwDe Pc0vdgkcqdmd5hWqg/B2wpmnIxFV7rjpXpzf+qpDa7DVDW32v1nT X-Gm-Gg: ASbGncvhEd3Cd8oYMKBX4ne2VjUvvl8JPm5P1KMrXfoQWotI1rND87ixAgPqPiSjRp7 aumtTaU39pngXpBqb7d0WsMkjQ4CsdVcD9K3TDcL1EJYD6IpKEKVdU1AInSWrp++Zh9M4CM5mpU H3uS5Ovdf+5CjsRxnymeC/LPYP0GDKE+LoeVXyXAVO4Pd/VIqUbnsTQ5/YCAkduh9ahC+pfD0KE Gmrt2hbyfvd35XCJcCiCy1DsWpPor/4XCtESIBPD646av9VtR943xd7oQ== X-Google-Smtp-Source: AGHT+IGe8Rwcmuo9VN1Lkb94sZXMSVEBxRAkdBXNxIt/1C+WWqsmcYg0Za15vXGe3lPDFNIsmfP2GQ== X-Received: by 2002:a5d:64c8:0:b0:385:ec8d:8ca9 with SMTP id ffacd0b85a97d-38a223f5c0dmr23948509f8f.42.1735428775256; Sat, 28 Dec 2024 15:32:55 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8475cesm25785410f8f.57.2024.12.28.15.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:32:55 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:40 +0100 Subject: [PATCH 1/6] usb: dwc3: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-1-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1573; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=pITQ3SISHmNURCP92MPtMIDVu2hGeerDTBhUOZa4ipk=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqk5Qr8I8UCU+eXHkVfaa5GP81eSw5Fhp3mZ d3XzeEUBu2JAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpAAKCRDnIYpo1BLC tSpaD/92t81iuqxEUHcsYt5/Wd4eQOM5eEy6ZSir1T7uL3om6KgK6F9iIjSVBlFj6kEbB25IJ/h Bt1oVYolifnCrjPORvWAOSIw3MWCn1Osds32OjHMKm3W8nWcwB8bDoCMZBFhtpioriPGVKTjdZW PlEXPCH2XKcSdDdqB0Tw55BruLDg+f56q2fHv88gAjRqPgt7HS/IpOc/cdp04Z2k8rv0DL7Jg2M kUB00pqUBL0ghgILZkXQ/ylZJZSSQhyN7CeVrK7R6YBmUDf14wnLHEFOqj8Wj6hKR2cILhfftu2 8x1MvvwQrupvZZoPTGCvPnt/E9Pe4N6LTXHY9fq+1a3Y5jJeFgnaYmgk6vAHEVT54lTshPXJ6iK oFdHkO6bjUb/71rNJrug6/BCIr+7VAkCnaMeK8NB8EmKeUNmo6pgBgzpLexiQrardLh+J7kq/pL kpaJR6FSoq/KZWSzWtpyHQ9r838IHznXZ/gd3O3j4h56wIsNKj1xC6N3fRBGoqGr1GAiwTAb1qb dOzLYzkIRXA4IlPIDj1CbJ0Lvf1y1Fis6k1vwl1Cz77RCpC4wa7/1uoB9S198DgNdoXvy+a/5QI oMezUW+nv2ob40fcPfwzr9abnCP5iFLv/OINnqBukVW8iUUCjreXiHUuLpBflRfZD2ia/9uLqpa bHzvuymCdM0rkJg== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241228_153257_063967_2BAC5831 X-CRM114-Status: GOOD ( 13.63 ) 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 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/usb/dwc3/dwc3-st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c index e16c3237180e970c184dfdb147c8abd46ff429a3..ef7c43008946e15b72d88aba4941dc52bf0788d7 100644 --- a/drivers/usb/dwc3/dwc3-st.c +++ b/drivers/usb/dwc3/dwc3-st.c @@ -309,7 +309,6 @@ static void st_dwc3_remove(struct platform_device *pdev) reset_control_assert(dwc3_data->rstc_rst); } -#ifdef CONFIG_PM_SLEEP static int st_dwc3_suspend(struct device *dev) { struct st_dwc3 *dwc3_data = dev_get_drvdata(dev); @@ -343,9 +342,8 @@ static int st_dwc3_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(st_dwc3_dev_pm_ops, st_dwc3_suspend, st_dwc3_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(st_dwc3_dev_pm_ops, st_dwc3_suspend, st_dwc3_resume); static const struct of_device_id st_dwc3_match[] = { { .compatible = "st,stih407-dwc3" }, @@ -360,7 +358,7 @@ static struct platform_driver st_dwc3_driver = { .driver = { .name = "usb-st-dwc3", .of_match_table = st_dwc3_match, - .pm = &st_dwc3_dev_pm_ops, + .pm = pm_sleep_ptr(&st_dwc3_dev_pm_ops), }, }; From patchwork Sat Dec 28 23:32:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922557 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 0D9FBE77188 for ; Sat, 28 Dec 2024 23:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=LKu4EPBvLsopgOFZpl7wz7qwa3Ue5APX8+1kt9ZJzXY=; b=1D5waYPZbhiu0dBKpVtGBku/Q9 2ctUqEH19mUoSIKUw8aRkxr5zRjKVYL7eWN6htweHXPGu/PkFujl3OCVxv/k8DZX5VZrnhg/DHcHX gT1Epxqh8zGI1H0/1SBEoUYzrZxY2krmrheVgyx8tf4VQwZ9DEsbq7Xb2Me9as4zPf7O9rmayzhrS VtXDhTRmTnc8NZMbPiRxnYsPLqA/Lj/0GbHjnPZWDGfyo9AqODEEmCsk5nT5myU4nX/gdtYGGMnZT g5ez8UI2UdvCKdw0Hk/PKLT+T8OBJOI4QZhQsgpgJAEf+XiMb4QORBBx7NIprYdaUIJDew5gekDb+ 6E9U9W2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRgMH-00000002aq6-1ro4; Sat, 28 Dec 2024 23:36:37 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRgIj-00000002Zqc-3YOB; Sat, 28 Dec 2024 23:32:59 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4368a293339so40158775e9.3; Sat, 28 Dec 2024 15:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428776; x=1736033576; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LKu4EPBvLsopgOFZpl7wz7qwa3Ue5APX8+1kt9ZJzXY=; b=QuwEwtIKjglphHLxUN17VjQANYcEn7RhGnuaxBsGNPl66HdhZ1ZD3YwmTTvS9LGSci JbwUybMdx1hXALWZm+GJRToBbZwFMYnd7kRsajfiCJ1bVUn0bfAGIJ7nTzoWOxxhkPYI nleYXMZhQWAfARCywelGSy2mMbEyZ9N6VxUaJ14At9NVhAG94kh9FMgaHmLLLLv+r0k8 /+zi1oYfZ3Afuc0paDPAocdjKmqa8zP2lp3fr58bpBrVxTZR+gQESFIA/KD/26s/UkyE Nu3pdJTxbzGsR2wGPjOfIJENg2PpMF96fexRNn1fJ+WEAu6JQ1fvyYGrqaQRJff4KGvG TxFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428776; x=1736033576; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LKu4EPBvLsopgOFZpl7wz7qwa3Ue5APX8+1kt9ZJzXY=; b=h3ncwKImBRqnu+wjBLi/i5QzieRKtdl2tLeOIuvKlMKL/3ybWI/DKe7EYJy9pMuNcH +nIpJWzi72OBju6lIsKOOHaGYVk9P1ZeOEGO36ftZuKqXXh7/Cto6AblfGA+iUdQCUwQ +A9CmfxNDixrWPgtg0HYg/aplhuIXwdIOXXY6fBiydzUCpugDSEky6m0filCs5skTt5w nfc//B6WWpNjAYYFsveRv3X4dcBItjmaCsLRoppBYFhvLRh1Nt2Jh/eowLLq0AG5y2MK 7SFOnQ1jhvkz/9sjkwW8z/bqe8QsVN6w8+9vvOZp+RRh+p+piAkH/Kld4VCYlY219DDq E8Kw== X-Forwarded-Encrypted: i=1; AJvYcCVxERMYsWDErGqKGEOwuX9eeGH/Yg+4bkf9l+SacFYdvwREJI+h8TjAhF/OErRiusUgTNOasVUTbA4=@lists.infradead.org X-Gm-Message-State: AOJu0YyBnKHJ/SCM+XJI85BZy0e5xDT1dFfKqU7J8QB9AvRXYra4dMyN nuooBBGUVoQ9zTVo8OmBTbHE2Yx6MOMLEIOAwr1flPrCWKRJk+iO X-Gm-Gg: ASbGncs1KRzHDwuBDzIgAIv8TN8UFA+08vSzYpYEJl7meV4+5LHCMCTgTrPr2YnOrbn sQ0AwU+JlZrk0tley8ZAt6xsl+WwgYqPXu3WM1RyU+edjiT8mAp1KpefqUQ+GvWvtgtiEF+F0KS G1+LXwPTWTv2GbTDDIl4i+qW+DlRW+GxKP73yX7spaZPEUzmHLbuZqe6DOavEwYcDL5ed8oFj+V 4pD5blkZs2vfyswrp604dh68f2EzI911PrlGtINpbqYL0ZdfcweTWoeaQ== X-Google-Smtp-Source: AGHT+IEFMVt9avPwZbEkQECNlih0Tj5apwRe3kcAhJ6WkS9XD2NmI7QYDZOlN1PK+TzmG7eJVzqslw== X-Received: by 2002:a7b:cb14:0:b0:436:90d4:5f3e with SMTP id 5b1f17b1804b1-43690d46037mr104959305e9.6.1735428776211; Sat, 28 Dec 2024 15:32:56 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43661219a08sm312165205e9.25.2024.12.28.15.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:32:56 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:41 +0100 Subject: [PATCH 2/6] mmc: sdhci-st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-2-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1605; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=0LBKnKFkf/CBAf2vV5CqDxilt6OKT0uPTamcOeeAqdk=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqkV+oVyk//zTE8gZslpR+kKKOstF8wTCVuV TKvMYBC/MeJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpAAKCRDnIYpo1BLC tavPD/4vrOzvBtiiJvKt9sC4OUwOCDInW95G7gdKLGetgoMPL841oWQyr9G/28XQniPi4LdT6m7 v0phn8UdBtytA77ajXuapY2/8ME5HKafYbBvhAVJsbGqHwDq4uTWZDV38h40Ll7odOwUniCSWHm Bt03pyV6HdwF64lkyn0pGoDN579sNaOHWW1uzn07Yo4mE+bV/Aa96/I87xWaMtiglRUNBuDWMeK SHLmnTlNcvlBc3MjUhsPmtAeTnd9Hevaw5MHK5Kq2jyg4Ixm5eLx9Afar0rxLpPZiO7U89upIRG UZLL89qGSMcgBh4TXwESAAnZ48AiwQ1nCxhXne5Nug+Y+XVvpA1qIZa3qvecraz8aTQ0W6lqPEm yZ+U7m770MJmH9PWsNGpGQkbpV/m0m/mpqZwmonu9Lqdr1qz/4pewLG3+ZT1658XgOqwnj+cls8 ZqtnvNYqKMurs9OupShrezeNUioevn5bHYv8QlHIqU8KvmJhhd6ybeqchpUPz/n/kuMIyh3YHJ8 mToQrF1qUoCjt8RAZfqivZo5GVNIK0Bw8t677CoM5UhnFNbPZmQ934JFNbbdJCbYtwj0XfrIhBD MAzzXA+NSAoqzC4S+u2/GKJYki+n9kBcqr5N2nbH46jPNqxOsf+vz1K+b+BDhfuedcCzn0ES8mQ K9j1SwhQL4jmseA== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241228_153257_912300_39C355D5 X-CRM114-Status: GOOD ( 13.54 ) 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 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/mmc/host/sdhci-st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c index 4973e08a98f87380325566a6b18878dd45e1dc30..901e431976ced68d5b6e374c2dec93c9fa821d38 100644 --- a/drivers/mmc/host/sdhci-st.c +++ b/drivers/mmc/host/sdhci-st.c @@ -447,7 +447,6 @@ static void sdhci_st_remove(struct platform_device *pdev) reset_control_assert(rstc); } -#ifdef CONFIG_PM_SLEEP static int sdhci_st_suspend(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); @@ -494,9 +493,8 @@ static int sdhci_st_resume(struct device *dev) return sdhci_resume_host(host); } -#endif -static SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st_resume); static const struct of_device_id st_sdhci_match[] = { { .compatible = "st,sdhci" }, @@ -511,7 +509,7 @@ static struct platform_driver sdhci_st_driver = { .driver = { .name = "sdhci-st", .probe_type = PROBE_PREFER_ASYNCHRONOUS, - .pm = &sdhci_st_pmops, + .pm = pm_sleep_ptr(&sdhci_st_pmops), .of_match_table = st_sdhci_match, }, }; From patchwork Sat Dec 28 23:32:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922558 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 C4DD0E77188 for ; Sat, 28 Dec 2024 23:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=PxV9VtPwcOjfdreL/ElR6ztmuVaPGRx7ZtA/COvnbHs=; b=rw774zG1UihpcXzHlnvRSgY+Np l2tb611ifW5PNnTHiA/9EwFhrk3gSciBkEKK4wq6xOOZNF1KBdqfCxwKvYRz9RyWpC7KrLevbr0sR nDAf3w3TccFEBBD924Ws74tT1LWjO9SD7QoQgMuHrwV2OGy90+iUq6+1BkQ4q4ifU88egdxAux84C 5CV8bs0MAju7Os5fAcs6GKs1tIOYudFyiMS5YHvTjR1g2lUWf9+vb8xUpEHoUgZ6kUBdRbVzswWKz 0h3ZGZWeZyWWVn2rNtgmX3vM1Ich/EuSlZN+ouBCMdOPrLfT5Pgj1l9w1k5rV0jEVUAdsMF3v+F+O 7VD0jm3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRgNS-00000002b1L-3ROo; Sat, 28 Dec 2024 23:37:50 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRgIk-00000002Zr1-3gtM; Sat, 28 Dec 2024 23:33:00 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436637e8c8dso82146985e9.1; Sat, 28 Dec 2024 15:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428777; x=1736033577; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PxV9VtPwcOjfdreL/ElR6ztmuVaPGRx7ZtA/COvnbHs=; b=NfkaoeftJjqq91W9d27AopKacThZuA+b+0DaMPVmECATlZbB1b0rjzjYvo/2I+xTvr vhKLaDF9lF84Ybhuzjhuf9vZNo3qQKjjFH64feJhFrsL9whFBBkD2/WpgG2mJVeJ8yjf T6ocbodszWyzI8Ips+PR5O3wBjE1i3cktG+lMw48zQ7e9oc1yc1642n/17jF7H47k9+1 hxnrXnkskrB0IYy0dlaO12MEvoHFuNecU3s4eiyBWW+nK6H0+mNiPT3RBhT7jllTSQaR wIi1cO24d1RkjE5eEnIs3m4k7wsEmSTB/aJX4Vd29hpa01L6S5hP3eDfIGRGW8X7xYM2 YHRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428777; x=1736033577; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PxV9VtPwcOjfdreL/ElR6ztmuVaPGRx7ZtA/COvnbHs=; b=H5AmJL7lGo2SGatakqzf/8fRjOaz/ghP+YzmqYJf8MyHfpC8sRdgAYMT/GuGUKo6Gl QeQqR+rQlBdzegqlmJXlJD44HjZHoYpe7teMZNv1By1U7a1xaV5mmiK5Ib8nt9CaxqzN AQG+zZSskIJdVsRnIz2GnM6oybwjPboeB34XR1w91QGQs4bZc2Zwb9b0AD07Xla1cPty tiuvpsTNFCdhIy/Jm7mENRAaEp0MdWEPURuWVG7mAW7F5+rvJwbmGJc7weC9km5+b7KE vigextT2ZeE+E5kieNDJgP4SxkWEXC9zyCWAjanXLzGl93bCxhH3Nir12hjE8pCj9o7t 3Fcw== X-Forwarded-Encrypted: i=1; AJvYcCVy6mT72I/dKzyvtr+gae8pA5P7GBwZNGMA1iQB7tM5YEzIFqIT7zSIqfzSdvd0VxWxZvEUkUIAH54=@lists.infradead.org X-Gm-Message-State: AOJu0Yyk+ExS6Kio1BUQoCXY247Ye28zohSpyfpDMwBXO3XfpukvvNk8 KmpbsqI3dKDbqKFTbO5QDvgMf9Bty18BszQ4oQnKyQ9wp3q12X51 X-Gm-Gg: ASbGncvYDbxMJxpGb1t+AXTaV421rQ3Uk89apb3eS7IPFNgKsbx2sh52aEZ+sLetoC5 TlKBQR/CfUCdKWylv8KzzdPKZie0Y6YvY62kyBewjLbdyiB37RO3b4/3nLXwYfvXIX8MdMh/S6w Cd2RWioQkkRObRvgvxwxhzzH9ert7U0PUbxncIaGFkHLYd4O1t8cTDxT8LLrAGIL6X+GDjPgcIu cUJaXUnwMjqrGj2wX3W5I+ipIDS2zPJnmwTaLl3CRxs6IPj2eGw/ZZGfA== X-Google-Smtp-Source: AGHT+IFXB6mtbitt1Ty/iT+t/Wxyvt+fr2CPLQ6VRcW7h6pu2iRFzuNW50tyST860x+rxbR3cQJGsw== X-Received: by 2002:a05:600c:3b20:b0:434:fa73:a907 with SMTP id 5b1f17b1804b1-43668643bccmr256788785e9.13.1735428777279; Sat, 28 Dec 2024 15:32:57 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c89e528sm26232100f8f.83.2024.12.28.15.32.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:32:56 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:42 +0100 Subject: [PATCH 3/6] mtd: st_spi_fsm: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-3-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1621; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=3cZeUXTp51nnkA0ehfcJ3kzlhmQfCuKF9N0XQDOcDK8=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqkunV0YUrJmo2OxF1WCeGsLT1QpLwOpvdep XrGjLg1MXGJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpAAKCRDnIYpo1BLC tYhUD/9P4jzfqCUfSrApK6lmfba4E7uCY6h7SzplroCGW1ScAmboJ/iYlxhkMHbAYfLQ771Sy5X GApAEGp4oyZ3wXnMKt8YIdaZ6hmJTzeBWIsuISUWUx+2NFEqQQ3NuKR9fyjjJOz541V9Sbrbhj5 dKm2bsvCeg/vFy7uEo6HCGmbFFrdSMUOahladMZaNiFyssMjt5B+Oxo9WuGPd1qecQKGPVIsqS0 Rnlrb/7nduNaMV6u5peS3QPgq/rW8qodw5k+1u7YDrMbvU3jOpDBbNkZ1S0sNxBnoJ8tnAjwDk/ eQlg2JFElPRIvOnRWXngSOzLgvZR/nHaFpYZiZnfF32pvu0VFABQoQ1JL159abwroLScvR48/C6 6i2RMm5ARJf5RdkBoYai3xU93SvI1qxjYucRkE3uj+mMTZ0PUrftZ3JZ23DMZZG8WnPNfh2EOxW xWL1/3THYy7Wl7qHQ00LPyMT2NRocPs+0Tp1wzMaRVMj0q6ciGjqJ+QYHMZlHbhSh5sBCuqRwmu 41acQELy7x7I3k01wrZ1sy4TLYyni32a1fvdO2G/DWSvUSDhFTMkl2dhQUfKpv0VrXcx331yS/z p0to76g+3pC4HZPGpFzKof2JGxRm11hvlh2tzpvL3RFL3eaWjrtMGvmM8gXxvtCcmh8Ha9CGnNI ovHV8xs1qQgCQKw== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241228_153258_975465_4FBED4A2 X-CRM114-Status: GOOD ( 13.56 ) 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 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/mtd/devices/st_spi_fsm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index dba584fa2a530b8d32eccc4ebc4d04ce01582ca8..f2266145b82167a4f7a063bcc7815115815483a1 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -2104,7 +2104,6 @@ static void stfsm_remove(struct platform_device *pdev) WARN_ON(mtd_device_unregister(&fsm->mtd)); } -#ifdef CONFIG_PM_SLEEP static int stfsmfsm_suspend(struct device *dev) { struct stfsm *fsm = dev_get_drvdata(dev); @@ -2120,9 +2119,8 @@ static int stfsmfsm_resume(struct device *dev) return clk_prepare_enable(fsm->clk); } -#endif -static SIMPLE_DEV_PM_OPS(stfsm_pm_ops, stfsmfsm_suspend, stfsmfsm_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stfsm_pm_ops, stfsmfsm_suspend, stfsmfsm_resume); static const struct of_device_id stfsm_match[] = { { .compatible = "st,spi-fsm", }, @@ -2136,7 +2134,7 @@ static struct platform_driver stfsm_driver = { .driver = { .name = "st-spi-fsm", .of_match_table = stfsm_match, - .pm = &stfsm_pm_ops, + .pm = pm_sleep_ptr(&stfsm_pm_ops), }, }; module_platform_driver(stfsm_driver); From patchwork Sat Dec 28 23:32:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922560 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 E6BE8E77188 for ; Sat, 28 Dec 2024 23:39:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DfubF/yufWY092c2cPTjDejWqTWBBJxWn/OStLH2dG0=; b=aHgdYCGfK9MzgpmE0tzTyNmrDH VJ3aSK/NzvszI2KeicrMdBEa9PR1z+SN0O8U2whtA5ysiHyv64NcYGLa7CVNvrOGvY86sFYJ/gVAW BxDpHQH3w2BZhCHghPU7TYRlY17Im1s1jgKwWmAU5AClXH1k00wfo2SWLbd4CbBi1TsxOoX0FhKAs O0yrJ0jYA5gWUOytysRj7ngkKHvUa82XbcE3xbqj7SvCjq4n2t5nSXm6TWQoYwJFijnVlzIqsfAEU J5mBFaciCTUgTL8OU/ntIXqGHwPILqcUhe8uiT+cpUJ+ioaY7GbVx1N3GieetV7oW2HOpObylrvU+ Sx3cgTVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRgOe-00000002bCd-1hRa; Sat, 28 Dec 2024 23:39:04 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRgIm-00000002ZrW-0XiT; Sat, 28 Dec 2024 23:33:01 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43618283dedso82166825e9.3; Sat, 28 Dec 2024 15:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428778; x=1736033578; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=DfubF/yufWY092c2cPTjDejWqTWBBJxWn/OStLH2dG0=; b=OKElZgUW8QrkhKIEPW1eC3/RL2e3XD1nsEj7h5DxEfBTEWn6sH3L+rQzq+LDav3weu sNKncd/hSEsMxCK8wQPZyOtJ8SRNlthhs44/kkl5+S/AkmrBJzW4snntFs8drhsjGup6 mE2VXlgffhdX7LhbOvtgYvbUVypk2U/6+E1vYiXRCvapIsqNVBVjq6BDnEy9Qb22ld31 hHdYnrPcYsJq3Ao0DQsfhNrN7YseC5dC3LTY+YnDRefTEXXCRecodUBCxWsbEvkYSUcW nmc9R/sxqRg132s49J9Vw+8EYNXRvDSYhWT9nh0nbnfpFQ+JZi7RmLJldv2f3ICnVhsg gMCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428778; x=1736033578; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DfubF/yufWY092c2cPTjDejWqTWBBJxWn/OStLH2dG0=; b=Xl4/n6xA4pD4sisbG7AZPOc+YptZa7N96WIqtJSaoRY94aHCDbxHGUdDW/KvvwDezm aWLVjyd7D7dDIlq45Q0yUzS5OcUVqiHmaKYFSOxdIeQ7oRJQR85PfLUrpARy2NTWIqf1 XP6oG3alX9PsNktgNdtMWOiaZMhhVn+HUZ7YiTf8zSw93sReuopm/had2sbIR8z2wv75 SxwOdGqv3xaxOHnXw41zESAaqUFsiBYx/A3uVgrP+hGVCgZdIHfZiFfhKPCxP6N0PoUC 83LYuj3PKG6huCFXXbjm0X4MDv9KDInspU5xVO0R+Hr4bfuaLKTRhmyGaJi+xPEBY7ni OfaA== X-Forwarded-Encrypted: i=1; AJvYcCUsgql1HT8N2y8kBtlzFL+yUKgGuQhrx62vOPoWYkxqmjtaZOQKflOe4dFWR5RWruwo5YWRpt7dRU0=@lists.infradead.org X-Gm-Message-State: AOJu0YwSvHWAo2ptp6luSRv7f9mhNYnK73bYIqbEdH6/c4E8k/yZ+5QP oCd4o1O7CxQjEnU9kJoss8mJDFo5D45Kf/JNw90tFVttgHZ++jlk X-Gm-Gg: ASbGncvuf0CT9+Y5lNeMbiZw+yV7RITlYwP8W/w4PaccmAJHHUoR2fETAgd44YigUWl H1Ipkvkh3XBx1ltcYphtqez6DlnpCqXjG/jRxosRAGIa022nO4tASt8qrc8HICl79TnRc9PPWfr OkINwqz5Ul2Kq4iyh9Qn+ZvrSw0ye29UIspzoXOnbasU2AjMC4R2B8vkPYIv2ppXiYLRQE4Yas0 uwCAg0OUE6XN/nt7IAFWe9afcb35fAzV9dPn9krvWbArZD6j9RbNoJ7Kg== X-Google-Smtp-Source: AGHT+IF2ClbgecNehGE5fWNtec9ewXlro34blBIKLgyQx5qEfdd7BFdxq3aJXVLuA8KbNB+TQ/BMPg== X-Received: by 2002:a05:600c:1c9f:b0:435:32e:8270 with SMTP id 5b1f17b1804b1-43668642f9dmr262491285e9.14.1735428778151; Sat, 28 Dec 2024 15:32:58 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436612008b1sm307077615e9.15.2024.12.28.15.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:32:57 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:43 +0100 Subject: [PATCH 4/6] ahci: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-4-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1549; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=puiG5xEDdJCtQ8qmQzW/cyD8qGWndW0XH0vnx7xw1nQ=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqkWao0M4f63BMEsxa8BRIQnaXQWygL0phkf tdecngcH0aJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpAAKCRDnIYpo1BLC tQJWD/9qfpDmwRN6zrCJNqZMU53EqDWlK+stpQdz2PxOgWM3IiMDfRC+jyRnvxeiWM9DBojy3CM eVzk/pzBMVdce6RrqEdBvSXEOhqvQtC1rwivdehnng1VXuGW7/WzqQ16lvPoYhaOeOSnH7v4S/Y 5OJd33Yy8upYHZK+CHEDoRw7Y1JJcLzOGrgX4WjCVSnnCwzlncx6xZwhUkwtvI1FO18X5Jhgjh1 yX6RZxXVxYc+3wdbKn6W9rDZZlfws37B0DfFdap3GBWMTfkNCgs+DGNgoEuYhZcMQxmwx66wb2o 0BwEpi5PF9IGK6bHuLEEX2cr4gV9784GayGuaSythX1VMWzo4yVE6o9ETY0gdEdQUx5oxA+R5iZ QkPazXjn8VJIjnJgxjrVaVcCjDt/PomoWdeLWNdPtcslOtcTqTWVA3PxK3YuF/r4p+9hHbaizB2 gnOwVzHIaLIKng0moZCBSHKUejWzwgkT/D692Qnwo1jzezsRFXBAHYBXxYC47FPUqrrNVLZ1IGW LSc+5kqpqWoJbf/J6FUi77wzfUAa7wwVSAr/kgt0ep2DMsyTxaWYy8N5KKmBIYr4eXWmdCr5IUv 4HsYTrNo1Tx7bDH04sfmhHiXxDpwdR5kjuWexjioIGfPKVsju98eeYPPJy1R6MG0pnsXFTTm3AW 1UCYQhk+nmIQ2hQ== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241228_153300_186553_EC954794 X-CRM114-Status: GOOD ( 13.49 ) 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 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/ata/ahci_st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c index 6b9b4a1dfa15bb6f395cc742f25251376b869a21..4336c8a6e20871fe25b61d6e2043fa15902b3559 100644 --- a/drivers/ata/ahci_st.c +++ b/drivers/ata/ahci_st.c @@ -176,7 +176,6 @@ static int st_ahci_probe(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP static int st_ahci_suspend(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); @@ -221,9 +220,8 @@ static int st_ahci_resume(struct device *dev) return ahci_platform_resume_host(dev); } -#endif -static SIMPLE_DEV_PM_OPS(st_ahci_pm_ops, st_ahci_suspend, st_ahci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(st_ahci_pm_ops, st_ahci_suspend, st_ahci_resume); static const struct of_device_id st_ahci_match[] = { { .compatible = "st,ahci", }, @@ -234,7 +232,7 @@ MODULE_DEVICE_TABLE(of, st_ahci_match); static struct platform_driver st_ahci_driver = { .driver = { .name = DRV_NAME, - .pm = &st_ahci_pm_ops, + .pm = pm_sleep_ptr(&st_ahci_pm_ops), .of_match_table = st_ahci_match, }, .probe = st_ahci_probe, From patchwork Sat Dec 28 23:32:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922561 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 6325AE7718F for ; Sat, 28 Dec 2024 23:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NOT7K8Ya5QmS9KbZEm2dNA6PzTUyykxaRlEoFqze/Wo=; b=pOJO//eC+y58R+A5xvL75/NACo okABE6zJMZ+BXd97zSJydBgx+agX+zsp9AaZNhIynV4J7P81TtQ+Vi9d520xeK51LNO4/YIug7TfZ /eoD5tINFi9n/Y0sJsq+7tTF7NG0kSXolmv5Bz8/+VTklMDOnAmOSzVrSc/iqeVXOj9W2LiUEmkVj FzJYw12T2qqxdog5b+x5liIqdE5G2f8V4jomKIlxmlitRDq87kHNNoriQMB8EGIhwGtR4hHGDGlf4 m0GCLhXyjSgC+ZR9kGjGJNTbuxH/AB3kG6zUUsK3ChdCVeQX9kNz+9YbcaZENJYLiiHbvcy8KjqAJ ETGGuVTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRgPo-00000002bOm-3xfd; Sat, 28 Dec 2024 23:40:16 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRgIn-00000002Zrk-0ZW5; Sat, 28 Dec 2024 23:33:02 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-385de59c1a0so4918815f8f.2; Sat, 28 Dec 2024 15:33:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428779; x=1736033579; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NOT7K8Ya5QmS9KbZEm2dNA6PzTUyykxaRlEoFqze/Wo=; b=akFMHbwiJVUSc3yk4XbSe8kcFgNvIsQ5Ih4PyRAA4h5RE2HI2ZiJPXt7z08jZXx79+ WrwzPcWdpnpcECoMD8vYKsG3xKiyrqRxnUbSchuUhN10INrZVktBJNx6DmIn7VvAM+BJ emNWi35jtUO3RlQ91ptH7DYETGbcygUB7VUPsj5jYe+hTAHbjw1rK9Nr2S9OyysWe3wL O4LF1z6hyJHR4xMG8HnEnGPihOk2HVOV1ib12zgpGqKqhySiYNoCLPfk7GoAx5ZYbXwq +j7Oo9eaZPbeKF5XpMuAkT7Ye7RM/2CVQxq7Gxith6Ekl3uIDBK2NYEiOlwVJ1inx+DG f/Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428779; x=1736033579; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NOT7K8Ya5QmS9KbZEm2dNA6PzTUyykxaRlEoFqze/Wo=; b=LYsxkQjfJv/mMv0myCoGVGrJQhZl//fUk3z2bHpEVpHw9ASiNsJrRC2gifAOHAbDi/ scuj3wygVf/2SlwEgW7LfXfzd6QTO3txq1cmxnDLrpsaMhfkBEiTf+u45iyFGaBFQp/7 X5M0rb9GADcUA86PsMJugLiaTjakPfBb+2JEgjgadpZtkeL9HmV7bFcEH7goVIjfRxaB w3yxa7eC+WKRXsUNtmxQw2KkCZfnXazKG2uq3/Ac6QjF2FVOuAXZDD6DA+mhzsJScL9S byYkKO6c1KyDt9T7Y7JNNYRRz/gZhuEG515MsmxbNEB8/J4K9nN52ueEkLqIht0u3+J9 0lEw== X-Forwarded-Encrypted: i=1; AJvYcCV4VQ+mkwH9jZmqQoYKCizmgEga1yv3TL8FDLEvWE65yMbC0WNNXQPxyNmwCngGQDUrsKQqjeF6OAQ=@lists.infradead.org X-Gm-Message-State: AOJu0YwlJGJU25UaT3M1sEVb675aOQsGkB98LwgLdz8b4GYxcxjizABL JgZklz8kfvbSV6Pl43tPnuU/pt6unDQbzrVrFhs8883CtrY22t3c X-Gm-Gg: ASbGncvl4H35JXQWxriy7XdCnrwXUW9BnKPa9+EU6YwcJC+JqjGMJTXmbKwQejI4w5h 92b5ht0ACH4MeiCKPzp7rAZhjWORUcrNmrr2VFNYfjItIhKD9y4AxKKMpAIcS9pyK9JiX0x3uzb xXaEC5E5hS4QEMIYFfhNpuPJ5eEn6rAvunjZTUshl/L2sGYOsjk3pBJOZwyErcQLWLe5gwQ9hqy 3rSBJcIiqCGy9zrw4uEcpUhAvHjEutRPVNpT1QSOLdFEjTyLh+BE00mMA== X-Google-Smtp-Source: AGHT+IEDx7wvGkLVUnT9AMtJHUHuNgRawRAtN+qgnC0Cj3E/aztBEivykLbd/wn9yN327aAFyzdA4Q== X-Received: by 2002:a05:6000:1542:b0:385:fc70:7f6 with SMTP id ffacd0b85a97d-38a221e1f67mr24709765f8f.7.1735428779386; Sat, 28 Dec 2024 15:32:59 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8a6ca5sm26538490f8f.86.2024.12.28.15.32.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:32:59 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:44 +0100 Subject: [PATCH 5/6] net: stmmac: sti: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-5-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1773; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=Xy7AdPQ3XNeeLhZR/TYDcrnRFX91WkBoxIfX4qqZmFU=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqkdCM7I2+fjKtHyJmXuIMRiTT3ConPrpraf j4VH3GYg+CJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpAAKCRDnIYpo1BLC tWOLD/9mLv8T49Aj92DxuFqK+5R3cczwAA+SNhe7B2SwXvfVYYd3E77Y+/6R7e61V78SrnbI8gz uaBNqyvNBthY5MeF0I+NbwVeOCkA2B23GaLT+QSAAgc/lpqQ7wFVR3ISSUhZfAT5dU4co5VkvHM xnEYsquomiIFCIsoOVZw7fvrHUaCfpBwiyPXjs+jaTzfcq++bCknVVo0bsn9SrV9v6OIEzL4CxJ 2Gec/Ah9nHgtAISBD8U11Ay92zy0/x8J2tmMEkLxjOFcmqZmJyYB0X1eyMts89qT1Xz+qxVwJ4b eGSEySEwcjMA401vbYtcTwgiaRaERA8MMXj2OjAznA2N2n1aswBx2ElmwHm1wBW2FXPfVapYd9u cKDauqd2bZioY7er4gOxCHnT7cvL+mGopN2wMggQ7N2mnGfAnVhUwo1BvvKnALB6XZUt4riUWco td11vz8xganX4BAkgJUrdabbCavIB95y7cYJOMpKAnQGDHRALdO3K/R9opffcvMi6xvmOl/amaJ z/7BF43VuNbdS0NTjhHxD5V9G5FlkeT31KscpPYrGl4XpRe4HaazkrXfMZr0DbWSBESGgi8Rj7V +MXQFC/biruMtBy8YzlG9rLxu1xkClx8ECgKGVnRJBpUo0oBdpjoD8/QjoS35kjJWNjGSlKyI9T uq80NJHRbLeVYQg== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241228_153301_182421_7A67778A X-CRM114-Status: GOOD ( 13.87 ) 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 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c index eabc4da9e1a985101643908d2efdb0b4acaa9d60..de9b6dfef15b3d0a503a3b55b3e9a42ee68c6141 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c @@ -313,7 +313,6 @@ static void sti_dwmac_remove(struct platform_device *pdev) clk_disable_unprepare(dwmac->clk); } -#ifdef CONFIG_PM_SLEEP static int sti_dwmac_suspend(struct device *dev) { struct sti_dwmac *dwmac = get_stmmac_bsp_priv(dev); @@ -333,10 +332,9 @@ static int sti_dwmac_resume(struct device *dev) return stmmac_resume(dev); } -#endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(sti_dwmac_pm_ops, sti_dwmac_suspend, - sti_dwmac_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(sti_dwmac_pm_ops, sti_dwmac_suspend, + sti_dwmac_resume); static const struct sti_dwmac_of_data stih4xx_dwmac_data = { .fix_retime_src = stih4xx_fix_retime_src, @@ -353,7 +351,7 @@ static struct platform_driver sti_dwmac_driver = { .remove = sti_dwmac_remove, .driver = { .name = "sti-dwmac", - .pm = &sti_dwmac_pm_ops, + .pm = pm_sleep_ptr(&sti_dwmac_pm_ops), .of_match_table = sti_dwmac_match, }, }; From patchwork Sat Dec 28 23:32:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922562 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 B8CBAE77188 for ; Sat, 28 Dec 2024 23:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=i3zTfYTmH7V6QXuNHKkMZLGYqANdc4Kmp0yLfTvIJII=; b=TJZpe2NUg9Z9LvfDKaOETn84lr ZePA7cEuzhIKDuDXzpyIU3D4g4nTQfHgju/MoTJrAOvf7fu/svBYv0y51Fkdj6m6sEkmtFEugxkRA e9i21/buTEq7F1I7THrVSsp4rAEljpZdbH/dZPvBA/JJf2j/zuWodHJ1eXv1SoYORmvrSAj6Qv9MC Y6RJMppzXr8ZZhrhGg2SCYps4UtxYIPb2EIYQJT7X/62M89hE5GvvUh3C+5uaYROwA0bKaePimWBX Q+2KLp3CfUjWNQy+LkIfpwYYGXQxTTtjDAzce6vyyxXjKGPihd6+XlAGxxxFn5MoON4oM8ggi6Zb4 BEVRceBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tRgQz-00000002bcK-1QKv; Sat, 28 Dec 2024 23:41:29 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tRgIo-00000002ZsO-0R0w; Sat, 28 Dec 2024 23:33:03 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43622267b2eso86860625e9.0; Sat, 28 Dec 2024 15:33:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428781; x=1736033581; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=i3zTfYTmH7V6QXuNHKkMZLGYqANdc4Kmp0yLfTvIJII=; b=cfH2yvVoGWGHy9LcuhiGRdTP3ecs3QueZEGMWqLjXHxYR2lKnbnvS3m7da/WxnHb92 HM6sOk7LMdMJVgbIN58e7qXivHQStuWn97foFvUmnFbOmYZcmkToj1S1cb/1rFy4LQfI IrFqV2U0I81y6FMzY0dLEpQAWu/2bo5NSKZJf/U64XF8j0XfgUBf2VastkPkbq2dCc1b pbJWzirZEA7vl4QZpQZ2CJ2NC8IauZfvI8teBInUOh5V6FoHCCY8mnJAIYg9ElH4cruY glQyet+31CLthIGCdSoI1z7m8yrdAW5eOqwY88toZ7VhXqec/iQvnlRQNg34EUujClAB Vk4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428781; x=1736033581; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i3zTfYTmH7V6QXuNHKkMZLGYqANdc4Kmp0yLfTvIJII=; b=R+F/44ieaemUuGgwH0Gtjzl7iQG4eTGtH688ifjgLWLzkO0xPkGlUeFMOs+8YI+DtF DSnyI2c0mlIRD07jyzAlO3t2r+Z1hNFfAN0JrXT/Ndb4CWWt9HTHdLlTXjiBc4k97Ba+ 2JBVbNeUs6iYPWVwSR97jlx5HMO+tmO4S/pIpw72A3seJCErWRnHulzLVP+QF77SuWnQ iESHVoqZGldIK+6uOHusAQwnEPdDCXF2Qt94r1WWvZSkhpfR2KwTIswiZJoKIpU10PjP O6MpQkSOI+yiLtecFu6YpfAouqlcZ0qUSycf9zQjeSPdJSmrWzB3ZroqrGlTvSG+XWrT b7Wg== X-Forwarded-Encrypted: i=1; AJvYcCVq3MqgLYDxWRfCnkH1Sxm4Bf3F5KjNaDPT2K3h35CYUi430cDfjvV7ivlN0AgC3vG0yUgECYq7Ht4=@lists.infradead.org X-Gm-Message-State: AOJu0Yz72VJ/3114Y23N46lfQXsIk1DqMpK5dOEIfa/7gN35669pe/0L v/KiaTnNyIkAHE8gl8yReb816ZDKXjRU58ZBkea8/jt6wYeqlqE1 X-Gm-Gg: ASbGnctOpuvE5eG4AXPNnjpmQYMHm2wCCGuAnepojSrShEiN5rHJ/a5nEA7nW3/djQj N8rNLLwxZXvtQ9Xlv4kY0JgO9PK7lvK1IWf3Gp7AmzC5yeblAwxyDBkACIgc/bgWU/+/DyDtStK 6MTOzHBOGH+S2qWhEDvD5gA0JdAii49FBR8LQfztmZm1NnFIeWPSPJv0Fl/eSryNIvkqAucPDkd ClLKNsqAwqGlcNoXt5je5PpwWSWcyCCupFclA61Sn8yXsmz0bCAA1VqXA== X-Google-Smtp-Source: AGHT+IEcJYHmTXyjTQ0IKDccCfhouFmdjCPXPJuqVdFHdCEXf871k685aGmx4Gh0Y+WbNAty4FI1JQ== X-Received: by 2002:a05:6000:4021:b0:385:e4a7:df07 with SMTP id ffacd0b85a97d-38a223f76a3mr28191587f8f.42.1735428780424; Sat, 28 Dec 2024 15:33:00 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366127c4b0sm309653465e9.35.2024.12.28.15.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:33:00 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:45 +0100 Subject: [PATCH 6/6] spi: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-6-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1701; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=2SAyWje7KVs9u2R4zoEyduMFN1gU91zxKOMAXSN9WYY=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqlgyp8ozEWbmqkXK9N4hLvauXPgVgz8iuIX xBtJUtexBuJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpQAKCRDnIYpo1BLC tQjtEACgRG4xlJ7uKeIA7lnM0soMV6YFReYT4AAeQKOEdIX+sJjm1B/RWvmEgjXHXiMS6i/olGb tdDopgx+J7oOsCT66udg8iNHBKWlKb/czzNYxNoGUk7ot5nUdnl3Bpi4D04kQrhx0LX+BMyTZ1s +tUcKBW2RH7Kjv2vjN1o/ibE7G6bNCGaBwQGTQ9bQd4lxohl9pKtpGmSYvHzpKodw074qMs+YdT z4kVd89fIMpy7xqvrsFb27UR/VRPP8IpZ02niz+kXpcXaEQaVz6Gexv+T/QlM37+ep/oXUYpFEz wl2lxWo3Dr87Xr1tl8nkk9R+1KGlQXOCm+jQOBA5Glz7qtPq9KyckYmCnaioNMg4QZ1dJKjgN8E BP0o+AKr2SsiZrlB0eG59j0BtjMzxcHcTjtCqqc9eLfL3QxRkjDnRXslWdHYjK3xarvL4qoWFnc 5SoEnxWQAzlBUlnMQbMz+rvUOBgBf2CkbJL00q/21GlSPaafulA5Ir3UE8ZutbThESAmOb3YCCC 7KICCYh5ru3stSIk3v57JjCGG8OmoViMTw9TdUI1I57+KNmiSlNoC84LUAqRsXLEl2kHrXrPH46 0b5vWiZUeMOn33qDrFPEiGuHlzP3BcA0M7IwZNPW7nJ1rhQ6H9dkT9dR3nF1MtJg2X2Orpw5FsW Ww6pQALy6v0aVTA== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241228_153302_155498_25CFBB33 X-CRM114-Status: GOOD ( 13.57 ) 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 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/spi/spi-st-ssc4.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c index 4cff976ab16fbdf3708ab870176a04f2628b501b..5cc452447410bedf3c12893d94bc959892ac827d 100644 --- a/drivers/spi/spi-st-ssc4.c +++ b/drivers/spi/spi-st-ssc4.c @@ -378,7 +378,6 @@ static void spi_st_remove(struct platform_device *pdev) pinctrl_pm_select_sleep_state(&pdev->dev); } -#ifdef CONFIG_PM static int spi_st_runtime_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -403,9 +402,7 @@ static int spi_st_runtime_resume(struct device *dev) return ret; } -#endif -#ifdef CONFIG_PM_SLEEP static int spi_st_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -429,7 +426,6 @@ static int spi_st_resume(struct device *dev) return pm_runtime_force_resume(dev); } -#endif static const struct dev_pm_ops spi_st_pm = { SET_SYSTEM_SLEEP_PM_OPS(spi_st_suspend, spi_st_resume) @@ -445,7 +441,7 @@ MODULE_DEVICE_TABLE(of, stm_spi_match); static struct platform_driver spi_st_driver = { .driver = { .name = "spi-st", - .pm = &spi_st_pm, + .pm = pm_sleep_ptr(&spi_st_pm), .of_match_table = of_match_ptr(stm_spi_match), }, .probe = spi_st_probe,