From patchwork Mon Jan 27 12:45:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951310 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 A0BE6C02188 for ; Mon, 27 Jan 2025 12:48:06 +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=5UXpQLaAZHWEyD0pxCkPC9tyYvCIT3KFA3QpJPSo0x8=; b=JIu6RTT8Irm71GM8R84EiLvEwU vFqow6XjTDxvU1W3Uei0VZ4jN7rDjlZCgUEiPSZtXhuSzsA7N8Y5nZ0/aZrWKXHzLHcrfzSj+LZTC bYKvOJ0NQZILyRdwZY8hxsBZoZYxMH0bviQkvsk+uh6GXLX5321rWtxc9m/J2F2MiKJDWDT+k613n 7pVKspdh7luXqOwV/3EcIcY1Yg9J0xgKZ+G49RK6pbf4jsIgRwmkE5uLxfPL5cfGSrxG/Ut9QsFLa teVAm4idC02EKoL9URguAbj8i8whhRfrFXLgE6bXxAzcOu7T8pChdIMAr2HbMw2wLIOOH865Z98Zb Hnx/X6Qg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOX7-00000002Igw-34MF; Mon, 27 Jan 2025 12:48:05 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVk-00000002IFm-2PfQ; Mon, 27 Jan 2025 12:46:41 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361dc6322fso28883085e9.3; Mon, 27 Jan 2025 04:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737981999; x=1738586799; 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=5UXpQLaAZHWEyD0pxCkPC9tyYvCIT3KFA3QpJPSo0x8=; b=jPqCJTt1+0wtTjaISUJHDr6ojd9IbJsoIMeLh5i7oEx18WwDaLDBnKmcn39pe5OoKY s17zwltt9PgORSJfBM3WJnVrBG6rjHF5HMzqgcOzlULFmwMCXlFEZcRQoVcw7+hZyBmb 5xSzddyTJk7WTywkPo0101ZnX6uQjekk+V+i4NexsxSnM67qRKS6hEYhbgoY735Vnt1o xnzRXC8pZ4LdHuy2ADPGEB/92505T0X1BwSqkwJHzppqaZx5bg+4U+THZJZMDrE/PKcU NGOowoPezE3tksf1Q4PQ3EDsb0V2FWzCS//unLee87GtDOePYlcoI2aeWvCoDZ6qzBJS JBXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737981999; x=1738586799; 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=5UXpQLaAZHWEyD0pxCkPC9tyYvCIT3KFA3QpJPSo0x8=; b=TjgE8pDzz3gFAtdMT0wynuhb9rd603H7LBKIwnFW1MyTy/1d6NvnS5JCXt0SoUvTk9 fLkBgnW13cFpAAMvltETKQZCAqrA6M/Ld7aU16i7nymvO9bHk8fnNkn7HPUvUn7u3PKM NKMkwFnWOkniQ84umT1Y2bzaHdHanfeLwnJze8+dsYnEk5U7Vk58VT/Z54HFe/pionjp /DsXaFKRCGOJw1BTsP9lVWA1NoVw5PiOSoArLEdtAets6cwlS3AmBTEpAXTZqr2T84vV xFo0CvJh6ltfB20PnlnYAllZDMUSqZ2j2Y5aWA8nN1oSUvnSPbQrhFJ2HzPPP9EFxe22 7iiw== X-Forwarded-Encrypted: i=1; AJvYcCUhikeysPwWg/aIw0CLKec0mq/Iww6wVp6HKOdt06mc31zZvGm4iNTTzlASESfVKrXKjquoZ3xpgk2jURTRqdIr@lists.infradead.org, AJvYcCVAyhDKo/zSyiluKdqmeiqGlw2l2vg9s7blCLxb09I1+KkdB7HUeDCOTGUUxUcv6wcINtpqsX0JhbIDde8tPvo=@lists.infradead.org X-Gm-Message-State: AOJu0YwvXEsEtNtoRZP/gtwwzdx1aV2HsfJ6grZHDSfX52PuunvzvlMe rIM2mWfhFemCDIfJcOA12D1dyd5RbMGVg4S8vMMgStfckTtDd+s+ X-Gm-Gg: ASbGncsTj4oeJO7Dzfy1F6+9tbeA3+u8mNELvjqSIwv6i3WseKFCQ9IbSeF3Q2GlEew 8ye2xj+wWkZX6Igujxuhc+nSd9/nxyJwZtlVwm3wweloUT9IVrPxzWjiLyKk8tq5AlvGRoonWyI jaU0Yj1rfwWhNBmzrBVPblnCzJ1JvRuKNF+sWwG5Muk71GYig1PKOX+eaKlZF6CLwH9xFpdhy9J BwMVS7mRyR8vC8dDzlCrhe3n+Htz/Gxq+u3K7ee+S7ogCVkHX/6EBnVG+hGX3W52oNHMz+19txT 4jZZ X-Google-Smtp-Source: AGHT+IFcpebGZaqOLXYWPaGFtndOOwU8Vjebxht6JbYpi1k2FlAk2skEDPVNNfLGXRNNRoy7L722kw== X-Received: by 2002:a05:600c:b8a:b0:431:5e3c:2ff0 with SMTP id 5b1f17b1804b1-438913c9f66mr357781595e9.8.1737981998728; Mon, 27 Jan 2025 04:46:38 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd501c2dsm129176715e9.13.2025.01.27.04.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:38 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:45:56 +0100 Subject: [PATCH RFC 01/14] ahci: brcm: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-1-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1571; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=4mWrBHSk0HW6moMZXG5yPVWArdrATyoEJrN0gimIFl0=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4AqwZw5/RPua7LmhyMMUY1qD4nk4fuWdEjvn fkcBz0A+ICJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eAKgAKCRDnIYpo1BLC tZSMD/9QFx/Dg/L9PZ311iYUySiZ5aaWZQ+jU5ysXXdpxQh+9iGpTrscQRBVfUbxFgoRJOSW2Kz /LxP0K7C6laA7kH3NsToFv20OKKvAo8JE/WrsxBNU2jNxzXaaIq/qRjOFJFXOGqFduVyTxASc/D rtGK8zEksr6Ulazfl5E0iRx1TPrAR9NlKBvV0KAVSkAlDV+MZQ+S7Ym6ZmXk+6ilwUZeFANJY6V gEdR88tKc1CpsaswbsvubsiNYIoES3v4zcEGFWVJ87Zfe9Z9wqmEHrgB6G4DExJA1BkUzMDNKOt jCw1z1SJ05MeOeoDOaTWUKNBLjXsa9aqII8RXNQG+DQIlHq8ucSEbgEtYkhspqDfet8IBpPo/Gn lsRRuzRsrL/BthLog1m9OUJ7ex7384StiA+Xk1HgskC6pid6pOIUUEXB0irM3UvKWfAmCtvCiW9 o2eReO7PMqmkdf98ZwYMiP51i6TTly7NcLNSJOvYsQL0RqJaXTx3DMrb76yAQMCgex5b35hVK+7 wIY8Mvcvf+Qf+TOMoGYpx0AYeDw08fHub0truLO8SjYyrgmQh9QK+uF5pbweufGV/RxBxMjiAAs WoIUly+qQrUHuAK8PEwzjqcw1LDHLo4xd+sDE3Y55CJrne0v2nDd0QTopi3kcz7woJeJWjG8b0i wvyJKOEETeFoxvQ== 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-20250127_044640_617194_8650E619 X-CRM114-Status: GOOD ( 14.02 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/ahci_brcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c index 29be74fedcf01934e436481c66cb8d329284d599..3d43ed5db6078b3f07440f21aae6edf73d1da7f2 100644 --- a/drivers/ata/ahci_brcm.c +++ b/drivers/ata/ahci_brcm.c @@ -362,7 +362,7 @@ static int brcm_ahci_suspend(struct device *dev) return ret; } -static int __maybe_unused brcm_ahci_resume(struct device *dev) +static int brcm_ahci_resume(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); struct ahci_host_priv *hpriv = host->private_data; @@ -570,7 +570,7 @@ static void brcm_ahci_shutdown(struct platform_device *pdev) dev_err(&pdev->dev, "failed to shutdown\n"); } -static SIMPLE_DEV_PM_OPS(ahci_brcm_pm_ops, brcm_ahci_suspend, brcm_ahci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_brcm_pm_ops, brcm_ahci_suspend, brcm_ahci_resume); static struct platform_driver brcm_ahci_driver = { .probe = brcm_ahci_probe, @@ -579,7 +579,7 @@ static struct platform_driver brcm_ahci_driver = { .driver = { .name = DRV_NAME, .of_match_table = ahci_of_match, - .pm = &ahci_brcm_pm_ops, + .pm = pm_sleep_ptr(&ahci_brcm_pm_ops), }, }; module_platform_driver(brcm_ahci_driver); From patchwork Mon Jan 27 12:45:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951311 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 A948BC02188 for ; Mon, 27 Jan 2025 12:49:24 +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=neEI1yakl6Xdd18M2E+K/Ks+Ljapr5chXpNCjeaLAxQ=; b=27oG3j5kNo2qKKGve9RxdikzPY Nzsgx0O2O8leoK3eBzgjT2EB2xs4LG2+biumlqfeqOqvk0laFPjJwzgeCAP3CXJ3xRzwLzRjL6Pyu Y+JIgkFFh/WJV1rR8/cLIvNAnGG7l+nS2kOhgkfsicJ3mGPIp8aOIP6WrtYCC/PX16kTuP3GCpTyC erlzIskJk+3P5O+ONTfBporgiRMtowFP2R/mp6+uOt1OVUriyxnJkgKXRH5YzE9szCxucHw/QQ0um 1v7KI8JN8a1sBaPTLrSD0TZNkQPluVvbxTYr9ZAh2WJOpiQOc2RyD0Q9FSo5JRtbIWFpcDgxGOBve JjU2331g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOYN-00000002J36-2ybA; Mon, 27 Jan 2025 12:49:23 +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 1tcOVl-00000002IGE-3SQ9; Mon, 27 Jan 2025 12:46:42 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43626213fffso33873935e9.1; Mon, 27 Jan 2025 04:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982000; x=1738586800; 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=neEI1yakl6Xdd18M2E+K/Ks+Ljapr5chXpNCjeaLAxQ=; b=R2p5fUUHhWuKjf3pbJOYzvjqofNpdqZzBFSVB5Tpp9ATZVwC3iuoJ/YwrV1itg4M8T 5yBzKojIq9CFKIPezW2wkhiCVpmNJDiBc/wyiL5lTQFqY+n8kfx9jm27Ji5SuB+BHRGR J43zZnaHpJ83i/79jRN77h/gF4y1GciJI8Ni9Jnhi2ds7/gpDEtAk4+cCqLTxsxvWYf/ VuPiubHjzFpB7SqJCqZ8Cxky7YOvYlDL5+8YKoScnF/K1gah0AOXje9egFQJgYczGVnu WIQfQE4e0Pkw4F7GtYJ4EJ7DA8r+vbvuJQLhMET6RqGloxihlhtVCB4jSrGP0O5kvXai L7Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982000; x=1738586800; 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=neEI1yakl6Xdd18M2E+K/Ks+Ljapr5chXpNCjeaLAxQ=; b=QKWinjRY+CVnnzrgZapAiRoNH/fNbt7TqW69vJ1nlIWkrZMLOnExzACpc/PEMm7MKj 2kg4oT+smXAvnt+1+K+9/30VahlSKR1h5O8vpd/0nW/lmdFTRwB6jyJyqWkX/vjyLPYD XUdb6ShrN0tjiTzHzv5m884CrOW75XyU1cEjIFDkiY6UEMcCGCr4hasB11sTgM995R+f /xAzg9AlJlimxZr1wxVDcy55NspPO1xGDkieWFKD+W0Uw2y1Dr1xbIbXqUtvsncU2j1X cjJtRYzPt66P7TXTSFmT7/NTzIlxuJFuTSlu/Mh8nOor8TxHid2DlTqWbXXmwC904gRP r2Cg== X-Forwarded-Encrypted: i=1; AJvYcCU1ymmHIByV29OJ8ntJWdJtqfe1EL5Q1fBPKDleuQ01TByH/DC2/vCVHSMYltZlWSc9hiMbpp4gQdGqsNncazA=@lists.infradead.org, AJvYcCWZHnH0gdtQQP4d8GEijIDyQ+RMYs2RLP5KxSb354lFFypCtif34YpGd4KPe/T33JBfNASjX9mItxOE60Odikp6@lists.infradead.org X-Gm-Message-State: AOJu0Yxr0RiK2InntAAi/WaEhifivVUwWNc6UuSjR5SdDhImdOulWOvm hpGN7wTBlw0Mq5AUyTdHr9qekMdfoLDGUmWF1jeQJLLxfi4vTlW+ X-Gm-Gg: ASbGnctOXBg8XHiPVzW3Q6zuW2NW0FETKY2Pxj9YUyr1Pc8+zQSGn0MUEFADhQ+wnJR 8LdHRJAt6ZoIzGgoDJyT/LBaSNFEqN48seKYUns5Dx2K/JezvtrW3F+q0P68DiwdQBMpfAf2KYe 2SDih4aIFKfLMxuBHkHoW8413cL8ulcg12KkAyJAvu8gpelerg+Cj41WndVBhqHIrIBpgFdmifZ CHJdsHolfHdUTZIIeHujstM0nPFdNh1tx+FRZKZqN7EsfqcOZGiFwnkBQfYh0WOJ1A+fN8FJF0b +hbb X-Google-Smtp-Source: AGHT+IE4B3ZWBvjonvFeGkuLk5blZCAjtvZWvPZJwKJKIySnT1AS6AlcYkd8YzGAqRr1xASJxsefPQ== X-Received: by 2002:a05:600c:1c14:b0:434:fddf:5c06 with SMTP id 5b1f17b1804b1-438b8841d5amr149069615e9.1.1737981999987; Mon, 27 Jan 2025 04:46:39 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd501c38sm128625445e9.11.2025.01.27.04.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:39 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:45:57 +0100 Subject: [PATCH RFC 02/14] ahci: ceva: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-2-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1737; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=LQrJh1cj1U0MJFZHGoCZeLdGKBz6XSkjoRXJQp9xyoI=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4ArRFwGWZoghduZ5MsMtU5JP/K/knP54RrlJ u3CYrMYTkSJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eAKwAKCRDnIYpo1BLC tY/5D/4h8WBFOd6bLxfcgBA6HQZSQVHtRe/MmxwQhqArKIu3NAzo6IvI5unGAIVRFfP8J/6taIZ coTadHR6BS25WGCU/geH+pL7tlRftPl7w2KPA53Ty2vLyAcXhjTak2OjFJbepzYKyLGfcFm8Enk mvYUOXom9+osUVVZGr2Umi9NzesNQHW4+NmAk0BxAXY/v8/ABC1Pkv8T6gcvM2vbB5Tt4CqugXU LnC6yqpRf4bZH34M69d+iT+0cZayAlqbS5E8AMrICLI3tvOT69hALbx8n2VSfVFcho3CbJsZ2/m WFrLEpDUSjJMZ+PUCkuo2m6pUQHo/2qFKhd2RD6Jp2g6QGthqal4+J5pkGeN8ctZMPEydKW5Vj2 qhHjVovjhbYqaJUQZRw1hDF3lWToR4EFOQfsYk1CizgHiUnYxjOscVH59b7EpvgbRh0oihBWtN4 deMGS+5dEVI3fcGE15tDralQuwpz9z4nE57mq7OCGIPgMyTEh6rf5PCRQuF5tnM0P5k1oyeovBO hLm7yrCPsLqTSZej/Ngu6KMJBv/kP9z8TFv0kDKTp4Y4kqzsUNb5kK/qxEliK3qAEW5AaS3Q5jh 7JaDUx+YgJ2Veym0I/RZ9xlsUejgS8M/P3b8++OXTFiu6Ou1Gh/QDgZusSKawfMHCMOReT43FBy Rz4SB+DJyzfb7og== 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-20250127_044641_865968_0A463883 X-CRM114-Status: GOOD ( 13.71 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/ahci_ceva.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c index 2d6a08c23d6ad5d1d11a7de7fbe2968201d6095a..76e55f1f7db1f8349d696e92d8964af609532186 100644 --- a/drivers/ata/ahci_ceva.c +++ b/drivers/ata/ahci_ceva.c @@ -363,12 +363,12 @@ static int ceva_ahci_probe(struct platform_device *pdev) return rc; } -static int __maybe_unused ceva_ahci_suspend(struct device *dev) +static int ceva_ahci_suspend(struct device *dev) { return ahci_platform_suspend(dev); } -static int __maybe_unused ceva_ahci_resume(struct device *dev) +static int ceva_ahci_resume(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); struct ahci_host_priv *hpriv = host->private_data; @@ -398,7 +398,7 @@ static int __maybe_unused ceva_ahci_resume(struct device *dev) return rc; } -static SIMPLE_DEV_PM_OPS(ahci_ceva_pm_ops, ceva_ahci_suspend, ceva_ahci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_ceva_pm_ops, ceva_ahci_suspend, ceva_ahci_resume); static const struct of_device_id ceva_ahci_of_match[] = { { .compatible = "ceva,ahci-1v84" }, @@ -412,7 +412,7 @@ static struct platform_driver ceva_ahci_driver = { .driver = { .name = DRV_NAME, .of_match_table = ceva_ahci_of_match, - .pm = &ahci_ceva_pm_ops, + .pm = pm_sleep_ptr(&ahci_ceva_pm_ops), }, }; module_platform_driver(ceva_ahci_driver); From patchwork Mon Jan 27 12:45:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951329 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 F017AC02188 for ; Mon, 27 Jan 2025 12:50:44 +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=PqAXhIk6/9U92F97+2iMV3noNDyf/KAzFHUwKQrXPko=; b=Fsl8nGXQhKeC4GFct/onezjE9B MrlVwqCHy86im0XkaAIGF+LmR+hrnYKSrSxVkicxRgQgKHEzj/do2whkol8PVb+8bxjEdWqUmdHdi /DIzvGkjLcKa7jSnA76NEdhUqCmq2IG1wCNA9LKwg2z9SrQ3YeOxoGAgD8HRcwzWndAJkzZ3I8gtS fXqdcqF7RR5Jz0K+jf/ymgrZl+b2OIWLaChs4L7q1Mwv+2MV/Jm2Wfs4w6kL/U1qV35J96uqb/yFb 4Q7ICnxiZkX8eutHN/iF5iZFJ758UkugNLvvUtL7IpGcSMdGSJ5frTYh5uiopFYF/pkbniUJGo8ax TcsRN2FQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOZg-00000002JIB-020a; Mon, 27 Jan 2025 12:50:44 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVm-00000002IGO-1cRk; Mon, 27 Jan 2025 12:46:43 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-436a39e4891so29045615e9.1; Mon, 27 Jan 2025 04:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982001; x=1738586801; 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=PqAXhIk6/9U92F97+2iMV3noNDyf/KAzFHUwKQrXPko=; b=JoSoy/rDqwuH6EKjD1nmfHD/FHUEn+ftTTgxWjtgXADkgBQsvz9/2easxDYV5Bp+i/ uRhruEdCC2lbznddbhVsFRgMeZHrd5lQcgbe86yregUNTvw9KDJJvC/p8TJcvhtI7fIA pPpX9esTm3goqTf/vGow4G4X8xPSIJ5Lgi1RPqJt0o5JHOsvAknAawtSeaoj3FdLeKLw cNUREAOkn6qedOHDcOCldlFbojSFAgGvSoORCvxH90I9EgsjU4Fk0Y26m4seI+luI4v7 VPew5OsRoTUydFNTxjNDnQN/1QlKFJTja4x/CKfg2QeLl/FqfsQOFz4fcjlXZ1//B4kv iTNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982001; x=1738586801; 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=PqAXhIk6/9U92F97+2iMV3noNDyf/KAzFHUwKQrXPko=; b=eJPoHKoSvZ9zfiH0dcemUzU64tUYfPf4OJr1u4u+z5k+DMmDOtGuJZSrvhXrG4/47B l08exTS5JAbVr7SZ14H/rr//Diu9fdYK2NnFjlU1yzbjlrIQ7dN546gfAWc9vGuIUPW+ g4ckb4Rhd6qYuQr7K7HC4FFYlRAOzZUmTppa6xqmYg4q1g0Lm0HeMuh/pPEeyTDJljG8 BG1AGTCnMLoeX/UxFvOJc2NbOunSGUvNZudgpCL4J/HvgiTxH01xja7a/g+a/cjXQnJg dVvJbr0sA3jNoF/KLlDFoohcU8UgbrXYQSxhEIBuWrilHGGZ6QScHP9Ax0xOANx3lufx LFfw== X-Forwarded-Encrypted: i=1; AJvYcCVNsYtakROT7rwZFiUMPejTAdOzFyQLG0cYzxwwwjTRZo83PV+40MxFkBwit3SHVyxrQ2DJNOf+wSC3JGVmlqds@lists.infradead.org, AJvYcCVfn1ubVHYhAN+svqayoHsHoKUqiBomDVOX1sueKehvxu6rOw3yyje6jZe2UwvbBLFkJVr96/OtUapMY6dFBEU=@lists.infradead.org X-Gm-Message-State: AOJu0YzDpO1MTGLby/I4Mh8wT58xfx0WwEobI0gYfIiyZdZSPqj/fGrW cAE25dd0PgXdmc8pucwaG5Mk3+cMNhsIoQf2saYtN1OMHYwgtfQUns1uUw== X-Gm-Gg: ASbGncuO/6ql4bvoNxaYv/qIHCaUaMi3TD7ZzGstr9VQYBbPZjjToko5IhSWfy+mHe+ ecHulqFzulZq/WSrXSwQM93FqtCtkGIiN1MG1jedVdhM6vLFfxMWvY5KYcAKnpNg79VMCWVsUVB tKDuYI1u8mdq3hW31OEX8kDDEui3h1JJ/UBsncOn7j282UWAKyS1r72WoAkbB8Msr/Ksy9GxtYC EuBuMJwXJGIrm4WAK5Jsv3n6VOPsVD9ZBpp1j7X5/jsmx5rhAO1A90hqt4QDiZLol/BtlmKnb/3 MUIy X-Google-Smtp-Source: AGHT+IHpARUyFT0W0Y2128Q/x2wbxMx49MWeGsOuOnwEQsnLMO4O10VSBaMiBE+MwkR8ginshDZ66Q== X-Received: by 2002:a05:600c:5101:b0:434:f925:f5c9 with SMTP id 5b1f17b1804b1-438913c85e0mr362999315e9.6.1737982000814; Mon, 27 Jan 2025 04:46:40 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd48b11esm134149285e9.19.2025.01.27.04.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:40 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:45:58 +0100 Subject: [PATCH RFC 03/14] ahci: da850: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-3-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1289; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=JYTAGA6KLOpq1lfyYvO54YfNSto58DDQ8IbvFm0AQbU=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4Ar7H3XRvBHkCDJtwncEn6hACRSaM/B9MM3j TUlZmcdsxuJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eAKwAKCRDnIYpo1BLC td/kD/9fRfNqFvH78A73Xd9ZGCO8XYqGGm4sadBSeVvFoAPKLlbostOLn0qrxKrBKAASdfHqsaj T/2jrg0tSmdNVfMU8W/4oUg5coJHOYRBw7F2NCVWhufeBLqKUxlOIn41IvdoXEMhVGczp7x66HA eVtALOskcYztnLiGnh3dG4UHpgI9zcbAuZZvVqr+NeCFLzMTrINpprX+Kwplsd5vfjrcLkEkCxK ZXedZ9qdyxy8+UWffwJRw5YJIIKc0sB+dv6k+vY7Man1vO/kjVwnqgaa1SyziRV4+TIkNO7oUuE 7JZgVZR/5Ziu/eHN9Tuih4WuzF7wLEC+iPdGS8n/8LFu4ox5bCJFQb5iw0RzrZ+lbcp3HWBxddH 5Tr1VGbsnJF2G82s1MqRFeVz3D3Bi3WUU/Ms0i8NcIkjH7LpkT1lHh1Ab6R4wDkWuG9/vI4D3Xj QC5Omh1e+vXMm1xxQxa6hak4AiSlSrswqIikBW2TebydWVHYF9i2ql4uqij/pkDMj0cKkacwNIR LYhGQXC9ScWUnTz34+qUc3wODdoz3WA246fpAvohnH9YEGmac6ra73KaPeidcuF9k3vZErcQIX8 wN8mk7rbta1YD1fblRlqH0liNKjhbZcZZdQjjwbhmQ9jSgzP0S35D2ySR5Wa4+kTKrZ4c1JHODj zO3u5VfhG1/FLcA== 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-20250127_044642_431596_33052FEA X-CRM114-Status: GOOD ( 12.96 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/ahci_da850.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c index ca0924dc5bd26ba424b26bd040bf83720c96b56f..698b0c30de0d65423f932ab3c3d95787b692cb37 100644 --- a/drivers/ata/ahci_da850.c +++ b/drivers/ata/ahci_da850.c @@ -227,8 +227,9 @@ static int ahci_da850_probe(struct platform_device *pdev) return rc; } -static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, + ahci_platform_suspend, + ahci_platform_resume); static const struct of_device_id ahci_da850_of_match[] = { { .compatible = "ti,da850-ahci", }, @@ -242,7 +243,7 @@ static struct platform_driver ahci_da850_driver = { .driver = { .name = DRV_NAME, .of_match_table = ahci_da850_of_match, - .pm = &ahci_da850_pm_ops, + .pm = pm_sleep_ptr(&ahci_da850_pm_ops), }, }; module_platform_driver(ahci_da850_driver); From patchwork Mon Jan 27 12:45:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951330 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 0658BC0218A for ; Mon, 27 Jan 2025 12:52:10 +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=cVfs7u/bC6+4J/CfEnlWiXT6DaEn0LhRfzsd996fsQY=; b=A7JqmgNwf0UcPEEL5v8xyXZFve RKDVE6n/kR1m9pNtcPAvsLW6P5AtkreZrXlkVri0LG8cUr6bafUNHJHgs3ZE2xD8xeTWNTj4jewwn y1fstrYZBb8oW66Vywk5mrPnsH3lPfbvURsN9kB/X9T7O4n/jyhMtWZdpuqv7I5LYhMAv1u2sALPN HdfJDApPSkzcDxTryuX66SkxHyYCYhTDfRFsfKB14+ITi/rowSXU+bZXMe7I7e54WKhvzzRe7l4yA QIQu0tMjAv0su8Y3Qvw9nQD5LLnPposwsQTU/VP95P0EjjM8kWb3HuDkqdLVrjcLG4/KRh6y9s7fm a93odLzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOb3-00000002JdB-0n73; Mon, 27 Jan 2025 12:52:09 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVn-00000002IGl-07nc; Mon, 27 Jan 2025 12:46:44 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43622267b2eso45486165e9.0; Mon, 27 Jan 2025 04:46:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982002; x=1738586802; 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=cVfs7u/bC6+4J/CfEnlWiXT6DaEn0LhRfzsd996fsQY=; b=RYIb+tddn7KiyHO6M/M+037MIQNhTLd2k9yHqJL1CAIyL2IqfWJVNekSsive1hx7yY v9KqDsIdN8GUquDVTza+1ROzSs9CiXgLndJviKxyEzSSKIYicJ9ZNv0OGECUhH5J0c6I 2pvF4MxyF3hWvIunGWWiaaHcbaZC1UnQBY1BY4rkZboSivsmxpTcwT5EAikDoSgzI1bW R+MqdK2AQ7P3JAHf45N2bwkMKgYOTu6xVCd8yK3hURse8zgSIWkICRpP/qb9i1adU0Fv rMw2vEVyim6/EKfR2uKJd1Q8RCjHl52KNPTKEV50fGTEoDmh/pLlpR5SxheMfAiZmxEj IyFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982002; x=1738586802; 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=cVfs7u/bC6+4J/CfEnlWiXT6DaEn0LhRfzsd996fsQY=; b=eChkIoY0AxualHenxjDRt4lBHUvIvffv5uxWt0ZZbtjYrOrFoFu5jlzMILaLlxbLFz 3k/RoltXuD32NNdVG+/1F6kR8R4P0HRthGCOmTC2QxM7Snyje2g6coaFQ4y6tlxom0bo 9glnE0jveRa1MLQQEU0HI8xRVRdHxYt6lLHoSQg5CXkz/cepIv1GNjwbU2meUgj2vQ9g J01R6MR6cLrnRAUX78SHVHtyYjIDb9PfHWAvjKHIQMbWYGsX2t+oNKDQa/vYn2HhXUZx Pu6MNxRjFKLO6LxwHzXOvPY2XsYgTnq2qbl5zaSEEfJWqr27j4W2w2OENdDPCi3LmPxi hZDA== X-Forwarded-Encrypted: i=1; AJvYcCU//VqelAHcM2grOM0XLXDx8nqvEPNMPXLVEZxLm1FymtJLJpGfmMg3qUA0+WMjlT9gEdU3t/ylh/93JiCPcv4Y@lists.infradead.org, AJvYcCUHBqW2v/6exG80C3nI+feon2aLIljNVkS0BFrCmxX2tCWFaQEUolfIKuAtLfwaquWnSjFShNKA7QydyCxchJ0=@lists.infradead.org X-Gm-Message-State: AOJu0YxPidOPaXa6UL8OKlsqsXSftI28saESg3UEcRck2VMVBmwRUxp3 8mQUBUTmt1G6gH6MmUnihIjkL2FF5FvbCSk8J7+PS31AOATJ18lW X-Gm-Gg: ASbGnctge1mguHWqvGGTmeveQw2mqtlH7fpA6nFNcLz5B8pZu0UwRez7SvUYO44Wgv2 0eHjIBBY2IXKnyigNVfXwBOva0tSA34mN9AstH3z7ZWwJMBhozyFSsnNPCx2EoBm23MCMMDOOSy 0IXlCC6HT97UorDZXW1vo7FyzjCXrcwIutjIq50YBgGy4a33xfuqadgkXlsUS0tT8rH3tfXOe8G nDo8+waJlWowLjIP06spNi74lC7G4qiMGrkqyLFRAuFk85scwTtFqUYe/x01RLsAuUd5BexM+Ue FA2r X-Google-Smtp-Source: AGHT+IHO/ZR9VI0DRMcofIQwLzf01DYV/sQAqDzIwYKFLnZG8rtRUybzRdSJJBgxpXuRFsHSUi3z3A== X-Received: by 2002:a05:600c:c87:b0:434:ff30:a159 with SMTP id 5b1f17b1804b1-438912d54b1mr408036395e9.0.1737982001587; Mon, 27 Jan 2025 04:46:41 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd508257sm129236735e9.23.2025.01.27.04.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:41 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:45:59 +0100 Subject: [PATCH RFC 04/14] ahci: dm816: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-4-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1307; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=MLMI+xe4jCIVViG+z4qmFWASYnmXjrbqAPj9rw3IXr4=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4ArKDkEFE9Y3A5/bmNOJMKuAZd/TGXo/Hnk0 /0p5XyElHiJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eAKwAKCRDnIYpo1BLC tURaEACTN9XCdcNODbQBu+CcA358dwkWhwqcBpvBKiMOZuk7+bUram3CM+KscfMs2J4gd6MtfN/ mJ32c1MQWHifQWvKWmdGr0ooGdtSGWohsgTrfVhi9KB8eGk6x0bHW7Oa6nMO/+bH1XBpsB0NGt8 lXIhrHV9Aro7NvZiAp6oOB3ttVN38qKt9pdnA5zp/rNFfrnOZcYhx//s8ZOiR21PnNyOVag8OmA OTqWHR3pWFfC2fzT5NUG00T6TKnBaQhXEXczoDingtphAfQmOMG+y1za+ZrtTM1Ahb7gNuf47Ja 3Fm6oikO5kNJqf7VkX4HSIYGpMhV8E0eadZxxZnnfo5NnGwwwlWDmYx/H6XTI4+Tp2uxJip3Ul+ zosr9bo6XJW2rslEkJwDfPeeM9AIvuGfRgiQPuX6O0tiZeWFKEiDrHCpXfY5EC2vu7irMCitW2M JBW/vef5FWcx0wvsnOQ7Qi7ZyPtx6LXjxikC7Y2LS+TaLuoDlLWV+4mJrtniq2Gd0iFHqRsaaKK RPUxZjtg8KwWy0iUFXZGrQu6+Lc0VEmI1hmkEBZndGhBBo7Rh0sWQ/tlkvBFPkG+jU3/scbaqmZ gs/H79R23Gep2Ovribf5X2LTQYpPgNuxj/tbNOCOKw+TxFhMGgxXHZhZ1o6J+D9DVTps9jbb3ty 0tD1wvT4bx+yMwg== 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-20250127_044643_076981_F04CB1AE X-CRM114-Status: GOOD ( 13.28 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/ahci_dm816.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ata/ahci_dm816.c b/drivers/ata/ahci_dm816.c index b08547b877a1f77ba220e925de321ed034147d7b..cb30a55945b8bdb1efefab192575864220215d08 100644 --- a/drivers/ata/ahci_dm816.c +++ b/drivers/ata/ahci_dm816.c @@ -170,9 +170,9 @@ static int ahci_dm816_probe(struct platform_device *pdev) return rc; } -static SIMPLE_DEV_PM_OPS(ahci_dm816_pm_ops, - ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_dm816_pm_ops, + ahci_platform_suspend, + ahci_platform_resume); static const struct of_device_id ahci_dm816_of_match[] = { { .compatible = "ti,dm816-ahci", }, @@ -186,7 +186,7 @@ static struct platform_driver ahci_dm816_driver = { .driver = { .name = AHCI_DM816_DRV_NAME, .of_match_table = ahci_dm816_of_match, - .pm = &ahci_dm816_pm_ops, + .pm = pm_sleep_ptr(&ahci_dm816_pm_ops), }, }; module_platform_driver(ahci_dm816_driver); From patchwork Mon Jan 27 12:46:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951331 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 06CAFC02188 for ; Mon, 27 Jan 2025 12:53:33 +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=nESEkcTInuMDz2GsfwYxT1TFIHgtEftiPAD53B8tFuM=; b=EvKdE/TmZFXIsjiM0uAaiCWE0v rvLxUy2Aio8XrlQribLJJdKn7C2R1lo1y0I+HYBHYY+qHEdcZYd/C/W8Gc6kgsN6e3xJJTgUOC+r7 5pu7FqX7j74CB48Vx/V17fiHTXiZQbBXSD0EPhBYSC3tdHZe9CgQRSi2aseMlQgNm+bCPZuXguKe+ Tv8xOF5TEqj4P3c4wrxOuMJ6DLqWvpmoy99eUiIlM3Spix+z8GRwHOGR1TXTlnp9JuPPrsjUqL67I x89I2ROU+BtsaM3zmHZaTkVKWMRXUIrLC4NLGynzvdeFLovlxlCmiWACUIysYuaSD48b/pwqoVOoA Mndi20bA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOcO-00000002Jng-0dlR; Mon, 27 Jan 2025 12:53:32 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVn-00000002IHE-42WJ; Mon, 27 Jan 2025 12:46:45 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-385f06d0c8eso2412112f8f.0; Mon, 27 Jan 2025 04:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982002; x=1738586802; 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=nESEkcTInuMDz2GsfwYxT1TFIHgtEftiPAD53B8tFuM=; b=KirrtwCiyWowrMSEvisNZ6nN3O211R1NK/aDMjFqfxmrRmPkYY/K9VthUykeFesNwf Bkfe/I2mPiV522SY284d3cyQ959oyns/Yw6tSotGNMmneXVFmDCrKsnHi876WQHk+pwk x8qR+3nTWXXAh3QnsJZaus+Hm1aoui+mTC0dFbBU8F6MLPa+9k/BvUJHMT3gub560Qg7 mgCJ8PS2JUKFaMLbC7QZUZ204js4BaGJAmPmpnpQWpFkYEmrH3NDbWLftKIUnTDN5Lla X0/2EWvF6kC8PnFTd2cTXNxXMg09JCGqz8ofhvRCPhuttefgtYl2djBG3OZrQC0fCzCQ IpdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982002; x=1738586802; 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=nESEkcTInuMDz2GsfwYxT1TFIHgtEftiPAD53B8tFuM=; b=lWEhruG9/O7EPemYVxnLCaESgeaD3EarZFrPsAeDG7ltfFGrzw9tjgjTiSoBB/D2tv 0OgsaucA3irTrvFxYQhzdT+AXQrGiR+8r3aRCXJ7lzIU8TKRApKKcPqRCkmxJuOb/DkB 0vUtXshzGIiOsEwUTvSjol5mwNXnbJBV+V7OmKUizEzAzHg7/MJzpxW2R1+sEFP5HiWx /uBK9N3ixQ3OufD+qeRPAK7BqWMtu2S1L+yPULRvrwfJUbftQrufYlWY9QEUE/iuXoSP bd6eri8g/ntSveUuC41CXmDBl4iXUSzsu6UDwktV1NfgEBr2GtjTc9cStEUwdiH1CXJ7 6wtg== X-Forwarded-Encrypted: i=1; AJvYcCVWAGVoo2BgrJI0wUpKxIfI5Bgb25D/GNhsZIad9ZACPmenSihZ0iol7RVI45xZly1DSCZXiK0jy0+ODmesJt/V@lists.infradead.org, AJvYcCWNgJd6q0uWqnGDBkPOmEhJPDO6y6brwNz0x7yPgkDJMtx8Xp10AYAYp2QP9wmLbMtqVC9PFe+Jg8L2+Q9wQ4E=@lists.infradead.org X-Gm-Message-State: AOJu0YyF5mMNUgXs8QcqZmUwIz2WoYIBMQvr7X6YotbnUl8P6aas1nI3 Y//pphvyoKbq77JBzLCff5MbNgppErVYwglD+peEyGC13XWp8Zyi9oFbCQ== X-Gm-Gg: ASbGncvgTndC/Ds+dvGSmPwv8EwV0qYnegh6PRHpoQtAas41w9fh99xC8vtIjb4WHXc h07xVFCPTRqURHJI5Uo+6bcPKDMTWu3t37Y/lyR91hoFq6t/exlgeptYRKcrKkY/aHmpJTishSH fak+R0H0QunV1rJ6U/V/B1QTaGNkd10UMbq0T+/VfpLkZ2npVosa26MTTMwQE8dIE5BQ6rml8P6 rI8WE9xFfQ7+9F/bysHqFWR9lzaoN0TJYqojlsowHSQPOZ1+aPS805OObbsJgayTXLuIhs4LZz7 jsZ8 X-Google-Smtp-Source: AGHT+IHrX173KgA+rgqZHkHs3tuUNpSaSEXjwu22A+m8kddcmuDUjvM5y8f1hco6MglQt+NpNTfPtw== X-Received: by 2002:a5d:6d86:0:b0:385:e38f:8cc with SMTP id ffacd0b85a97d-38bf59e1e56mr47569296f8f.38.1737982002399; Mon, 27 Jan 2025 04:46:42 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a17d6f8sm10808250f8f.28.2025.01.27.04.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:42 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:46:00 +0100 Subject: [PATCH RFC 05/14] ahci: imx: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-5-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1494; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=1NlgzpHbgQbix3Tjr1cyaZKDfkb/onDz8/2tsI8b2ZE=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4ArlLlDES8G6JKV9p0Op22wBYtl2rLb+V7Ti W+1qGzGlf6JAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eAKwAKCRDnIYpo1BLC tcRbEACFMbe4lquiTg8wH1+fz/lciO+CSZR8KZFmtd+230WvkforLr5uPcLRedFysFe+Cff1WYs np7nr5MxphXZtLMUZSOxyo55mDN/cHAkMS4qWD7moxUnteX2uM2MfdYeAMzLBN9LlTQGscTFfft w/1ceUvnn/Np65CvWQbfGNy/BGY4B1IBS9x7cFnExYD49LbBPhU7m5aOi5TG/FabGKZzKAt1Eu/ 09kLqOs/xGogNLtYuEBy81+YCsRy+STuk6e1RP15jI96c3EyEgcXVvT1HBJqtmR5LDFmrzuh54u +H49Rc6/zpPai2e5km04GAJbJq1wNG8/ICar4FSN52KQoixJsv3ce9jJD/T4YQHRqt9IwmBv3PM FxUU0nSqVpOW2F3v1nehYSCCkTNX8NHdtISGNhtwHPTarAgtssNkuJSetHNJ5Wg1plR1nwUfzFf AXYCLS22gsqcHsClW6YseBZUsEX32zXkgL+EceWNozcTjKu9z0KzpRCAnjUPeS3WQE/R+M1abeO LJMKdS8C18mKQQ5LCp27eeA09XzI8Uqjvq3tvHyXGazGku36zGm8mGTRn+ppZYn0fa8qYtYd9qM hJwdL3XU11O4J0pt7nbGccn4oVSwn7GWba5qhczK5wU2DadFkkkKJn5gyHSPY60Glr/kyI3vYJN k/vV81JDW/BJV+w== 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-20250127_044644_005722_C6128B0F X-CRM114-Status: GOOD ( 12.98 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou Reviewed-by: Frank Li --- drivers/ata/ahci_imx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c index f01f08048f97aa230877e413ba6e416d79779c1b..ec75a16c630a79ce10ea98b16c44c9a3908f869f 100644 --- a/drivers/ata/ahci_imx.c +++ b/drivers/ata/ahci_imx.c @@ -993,7 +993,6 @@ static void ahci_imx_host_stop(struct ata_host *host) clk_disable_unprepare(imxpriv->sata_clk); } -#ifdef CONFIG_PM_SLEEP static int imx_ahci_suspend(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); @@ -1021,9 +1020,8 @@ static int imx_ahci_resume(struct device *dev) return ahci_platform_resume_host(dev); } -#endif -static SIMPLE_DEV_PM_OPS(ahci_imx_pm_ops, imx_ahci_suspend, imx_ahci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_imx_pm_ops, imx_ahci_suspend, imx_ahci_resume); static struct platform_driver imx_ahci_driver = { .probe = imx_ahci_probe, @@ -1031,7 +1029,7 @@ static struct platform_driver imx_ahci_driver = { .driver = { .name = DRV_NAME, .of_match_table = imx_ahci_of_match, - .pm = &ahci_imx_pm_ops, + .pm = pm_sleep_ptr(&ahci_imx_pm_ops), }, }; module_platform_driver(imx_ahci_driver); From patchwork Mon Jan 27 12:46:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951335 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 1CF92C0218A for ; Mon, 27 Jan 2025 12:54:56 +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=sjKGQCjlxoKyHC3MWupm0EMlVBTxZVB63YoUYqEoKt0=; b=26NvLyXf7pmFFnnAEouPQJre4K eH1HRezHlyAJglBNXOQDuxlHxTGH0YzAdrYRdPOiRelwRjo0zHp5hXFF2333BhtOP2B9Hvg7qo1yl Oxtb3vLPHnguiy3OBiKQT7LgquEO0oDLjF5mtlNE0IaEczujbCC3i5fI9uPws5OL5YGogHDTOfRV0 h6a1siJ7l3LtoNsFrgaXEz8ZwIcliHUvPnefG01MOTbEvMWy8/sizuuMn/7cdr1Dc1jCl5MpwEVMy 3Txq/xaQxBgDpx6Bk08KJ98eC7zwQ2Ahzs8Njs22/g0TqZYA1US5T9oRdgOGsd1jbeTLBbVqG4y4K En8gVEkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOdj-00000002Jz0-0hgo; Mon, 27 Jan 2025 12:54:55 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVo-00000002IHi-3rqu; Mon, 27 Jan 2025 12:46:46 +0000 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-436345cc17bso30865575e9.0; Mon, 27 Jan 2025 04:46:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982003; x=1738586803; 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=sjKGQCjlxoKyHC3MWupm0EMlVBTxZVB63YoUYqEoKt0=; b=Ggrjn2v/Pt0GK3GbqiqnOO/jpDK1VGzoc/vTPIjXW1BROqjdqg8kbxDrBFlSYIwuEp KDJuwXegybN4cvuCEk2y/++IvYwSr6BsNLiBwd6jk6vYXqs5p5+imcMWR6NiKvJrxfjL tObEJFEhtUfCnXlPIg6V0oQNJV8W9LDyBzN+kAg51n9hfjaJqmlJ9km7LDjyAHctUUWR SJqxHY4QpN3nzmFXANmsBUVh6an1QxSDj/5THQe3QHrfjkJ1bIkSGoj7ldspYupICzO+ IXc9vROcChfYajJNM23ZcDxQhGoh9dlGxMwMFET7jjDpd3oWhDm0BispWX2LrPknp1lA tsdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982003; x=1738586803; 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=sjKGQCjlxoKyHC3MWupm0EMlVBTxZVB63YoUYqEoKt0=; b=FAri2ppBBhO+Q4WKAWueM74ir+CkVb9nN+U3JyCjguCH+Y7EEbHMPXz+UiwsVT/C39 fOwtKoVpIrcBF40TsIo5JCl6jflqGQ9tCDqKfld6RN04/u/i/HyADLWMfHidSyHC526m x5ToL8Zfz+nBs4ThxvCcNyKz8g4VZViSnQSVrkZg3cs47ekoRSfQZN+OaxMuqubrCLHI 7tlg5re58wdwHnrbHeYcYlzWYKpQvvIyf6EI0LKArUPxklaNaVCLDa5b88f7dSWGWa+J QQcphVQpO+iy+LKFJLFB7tChNKC/WLCkw7HfqwoZOhmUyC6fxUiSRH1vdrc+80SlSf26 TKAA== X-Forwarded-Encrypted: i=1; AJvYcCWnEYPEVRCqFu0OoksqIiOthEyycRH6zSh9c1AtLr8rV7IqPKK3NxbjCBEyJXahkcQhvKzt9CJhUG0fFjOlJOY=@lists.infradead.org, AJvYcCXhMIc+umvzo6XeaRPfYdhXGFsgo4N9xG+QBcCnKzZZsWeHDMWfZ8EZV6qjXbfwgBlIL3lfxVwvaNBWdV0jJlWx@lists.infradead.org X-Gm-Message-State: AOJu0YzVf4+LoFN2SZXb9QJ+rFy1ZBJOP27chOpitorh7d8KSsdZNUlz Y5XbcylUsOpvFC6xsntksPRYBhooqvMjcMJXLYIJhVru9cJ6AlU3 X-Gm-Gg: ASbGncvqN0fQucNvEM6d9iclXs4myOZSFvHtefsWOOUU7KhJtueiaaAI2CU4JEhnpkD j11ZdMICpdH76bPy/+HKyOiqv3cGP0H0RC7mRSBE8cFJii0HnuMvy+QMArAhqZjA9cgeXKUpWRw st42UQft4Hu+u8cIpyT5qwx2sQSd0JvL8Yl3bzt4s6Ox+Oiw7j5lowaZcc1l+sTxCZ53qbW0vwm yQ/vx3kwlqQpwFuPKOQSc587H1Q6y/JW+9WwFp/G4BBGrJeenWVKAy9b4OhcvfZlFjYjXmnhnNm D2aO X-Google-Smtp-Source: AGHT+IGprEO5pdaTEpJfI5A74FsQo9nZOJ84uFe/gZrOTEtv5xh0dMQj1A1tPsGDBpxW+UvsnKe8cQ== X-Received: by 2002:a05:600c:1c84:b0:436:1b08:4c78 with SMTP id 5b1f17b1804b1-4389144fd70mr439685205e9.31.1737982003114; Mon, 27 Jan 2025 04:46:43 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd47f367sm130542655e9.7.2025.01.27.04.46.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:42 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:46:01 +0100 Subject: [PATCH RFC 06/14] ahci: mtk: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-6-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1242; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=uk7o4XEuCDy+1MRV3EDgkqSFL3eYMvAL/KrkBwR1yb8=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4ArP/dXj2VF2FWcstEGtxvysjudHRVgQcMUd svatcZOwv+JAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eAKwAKCRDnIYpo1BLC tZl1EACcS6SONQyqCW76vwJqLeVZij81JJC6Lc6vlKZCqpF4aZfAWFaEhJwoQq2lvvaUkhxVbdn tI7F6zVdj6qTx/f+C8UiuT/NXdG2SAOS+vNLfh0lESSQq5FpO6z7T9iuAZa0QYI6qvoX6E39MHT 1hoEBquSExHROVnPh9jmPhMC9YCbZ3lLDh67T+Q+xxvLw7OSbRqZ1JYlxJHQhBXhj4YPle8ZhH7 Hlzjaishlt+hW8zL1qz6E4ERE/kXUFe5NGXeMTbCHVPfQcM7EktMEsJdLikHP3JSWz23Apabe8+ 3/Toun6cZcuUJxBFaAUrKSqGJhN6ujljWR6PTCIJMdR3IQ55grzKXm8Ydvu5vb0ifeOc/sN5JRV LooLjdM9domNcQM2schcY9SveR8a+DUDNbgZQYDEiUtzm1y5ZZu5Yi78yfFFvnRFfio8LOkVkd3 G1OfRNEeXzIKVj6dL95ruGiZ5C1xwqkSxgVlhFW3TxilnrbMb1M0jkO3sUpLa7WEWy4YDclUr93 tRAJ/feyNqI/3Yg7YwiG/RTxiL1PM4dDzWa02BTU/BebkeK9ECvVK/a+W4Apgsb8UfKOTQU+5jj nuBWGDhFl5Rr0H1L/nXncvlVYG2RQZFmzn8IwfcHbBca4T36PelFvgNiALqkjPJi3s4PkzzqfOY +XkNBgmtI5tEOXQ== 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-20250127_044644_964637_033757CF X-CRM114-Status: GOOD ( 12.96 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/ahci_mtk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c index 7295b9066ae213a72a8c180a66ecfac8c2f46ff9..4afcf5e90e3b660f17b2eb0b1e3df446bef470da 100644 --- a/drivers/ata/ahci_mtk.c +++ b/drivers/ata/ahci_mtk.c @@ -163,8 +163,9 @@ static int mtk_ahci_probe(struct platform_device *pdev) return err; } -static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_pm_ops, + ahci_platform_suspend, + ahci_platform_resume); static const struct of_device_id ahci_of_match[] = { { .compatible = "mediatek,mtk-ahci", }, @@ -178,7 +179,7 @@ static struct platform_driver mtk_ahci_driver = { .driver = { .name = DRV_NAME, .of_match_table = ahci_of_match, - .pm = &ahci_pm_ops, + .pm = pm_sleep_ptr(&ahci_pm_ops), }, }; module_platform_driver(mtk_ahci_driver); From patchwork Mon Jan 27 12:46:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951336 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 5DBE2C02188 for ; Mon, 27 Jan 2025 12:56:18 +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=99yQJvw7FpzRgdFhYow/5Nzmw1VclDAyJ3HG8KXeU6I=; b=IE6YEd5YzrtQFnqFChufWCE2EL OvAga85rp7peLIQII55q+AykI8lI/mMWUu/+BTIW//6HLgm00sw3iLmRyjc3j8c0j/4zwDXkmhxgH jcdQSl3EHVkk33ZGwc1pVSf/yBCof0+BoAXNjhZG1iYAN+eXFT2vE1uLAQR0STuJ+AgJqhF0kkZli WDFNhMHyw+BReEv4ciL1kKg6vK9Ff0F7haXMLlTo7II9poObI9toAGI8Gs2Kc7EUFScIvOojgoRYX jl9OkYSSuriMdUFfssCGpkEzGKb/xBQQNYDu6KG5xsY3DKljTXHBHbQIuDh7C60ESNil6HgRL8JFx yQ+4GILQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOf3-00000002K61-1uQ8; Mon, 27 Jan 2025 12:56:17 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVp-00000002IID-37y1; Mon, 27 Jan 2025 12:46:46 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso30699045e9.2; Mon, 27 Jan 2025 04:46:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982004; x=1738586804; 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=99yQJvw7FpzRgdFhYow/5Nzmw1VclDAyJ3HG8KXeU6I=; b=T6jjScgbcyP9wEQ2UpbB4Vl28BEpSwoss4XE9NcxqfNjG/hvmmHERUwsoU5cPZfOLW 4swGxf4Bc0zYF+G9iVZvF72qJoZIBo2P0gOuGDcrL8avpJNcZwTX3V75yWxfir7lSLc5 VL/byf4aUdYEDEl++JAPalsD7JgRuEgsqJwrbsLTJQ8OVs0RUMko6GFOjRznZs/UOdBI Smg75sEINKh9jN0zMCCvnmZPiDrDg5FqWkvpUQQKh4a2WufRFLotTbNfubHoffUZK9Xd 9BERNW/Eez3Ih2S5YCTZpTf+KRYYPMOJ73YGPNAh2Vn6sccS9/oF7NW45vvoR3JK8Dba 5CwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982004; x=1738586804; 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=99yQJvw7FpzRgdFhYow/5Nzmw1VclDAyJ3HG8KXeU6I=; b=b1nliAWkmyANxfcFonTcjKNf6TgC88gJaKxXtFYtRHGLp8be4NZGh5NnEm13ka8yXE vI+UYdziXqrbyDFjMcrxnHK+R5xuS2vTue7yUeW/e2abJh7PE+fkGOw1RJ5syG52+Y0f 3od1x6nHgVHwfbddqwpGKROBforXFGTSphZXsw/B0mbw7dRbLdNAWCQuYscjM9XqnPY+ /dV7xhgavhU+sz/3qAPf/ZMq3zZoQ9U7ymSzXB5LPZEHBKfglx603AQGlUh40Em7BP2a 64eJ8QGxdH0yfbwPahmTGg2C3sN37JbHSfuYgi23NWUbVZr4IaPVS1ujqo0bDQd9VFzk am/A== X-Forwarded-Encrypted: i=1; AJvYcCUddvCgK+x8Bkjc6GQAQHZJnSMWICB0K0x32J3CbMucXJbXBSaC6iH/jTybGpji9MVIIjNjBnXE7ZfPTIrvM5HC@lists.infradead.org, AJvYcCXv7FT8ljeE75upau/XYRbmRTXcwnd8lPGQefw/UUPo/FSFb7hmrEkf9NpDIe6sMcpX271gekatOHiieW6okT8=@lists.infradead.org X-Gm-Message-State: AOJu0YzC1vMvbtWKcmRonFLC08NUNPKCeGNNIyQgfGLpVWJ+RGoffAFb Xub4BuS8tDHrbIL48Bs+8ppUaCnnOi+0S06V7eenKJuWUurtlG9r X-Gm-Gg: ASbGncuoQyrprJ1PUHMRB24aKZbSlWi5376t8pd9qXakPFX0kJzs2KRo5VyPJnqK7r7 gfWsJNBDbOdA2vlpeVqgG3fT5SRWiaj2/97IR1w5eJcPPGqJmihYu6JA9OKcBvxOF1ey5vfwhlE HLyTIwAK33WKNaLgNO/p7udOf2y2ukwRao/a6E+dJo8GZu5I52/XntD5za+PwUCxHbW3jHpsdj5 iZF/aTOmFQavBUf40HXe8467f4WFbCM/5w5rfm7N5t/StajBf6TLy8+3WS35Ppq1ZKeZofGJfFs RJMU X-Google-Smtp-Source: AGHT+IEzXfi1CJNqlEJYIv0M8GW1g0R+EoqB1v8834fNOrIJA2KY3Jm1vR64nhkSLO1a4e6G7kWiBw== X-Received: by 2002:a5d:508d:0:b0:38a:673b:3738 with SMTP id ffacd0b85a97d-38bf5688e01mr32366544f8f.33.1737982004137; Mon, 27 Jan 2025 04:46:44 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1764c8sm10813557f8f.3.2025.01.27.04.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:43 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:46:02 +0100 Subject: [PATCH RFC 07/14] ahci: platform: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-7-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1273; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=jtsYpUlRDrqFp7RoesBiE8F7bGnmxPqG1z9eHllOyN0=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4ArnbhTeHcXctkkP5+YTLsGuNIu3latgSJOo K96meEhDp2JAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eAKwAKCRDnIYpo1BLC tSKXEACZC2yDU102fcE/qoyz6wlJRCDZkBrZO7Mia21i5SUuNDjLaYr3DTEd5Rl6C5JUr6CWRK4 AOyqi417PD/PwNi6a4MhVe27GmYTqJ1ZFgG/vUOWhrKzokMjs1PMH0E8jvWjseeqgWw31ngGDcD wb+QFUPZs7tJ6IB6f6hVeUox7rUiVvjuyZDtR08VND5UhRXXG57I+ZkkvniQUJLQt9ZzbPNo4x8 gGglXMk635txYfzMQ+A0s5LF3u4U6hVkmzYZ8+sPQDi2PvmdpdnJkwMX2FTgHwr0XnB72bsHazE Qd+BFCSx8dBGTmad30NQCFwTPomf0/SCW67dfkeQDBesTZxl9xumd7bxs8M1put1RHaJMM+G7cO WAjaN3Mm3kuJDjWHs+jEaA06rndfPYhgqewwkWucfergWLuo2MD/J8y5xwqmmQ9wfe6aeZ4rxsg Zu2TQUs4WpQ17vauPW4myryEl2D4bV0ZCUhldINKLd5e3vJ6kuOhkUVON/uUJu3VgVconknh/kk KsoizoWzHcJfOE89+flaHckKCLpzNxUTGXoFOL05g09d9C/oojU8/Epzm+r4MoLRNlpPvkxElGv WkvElsJaG2eXzFOeddLVygkSh8gUC0xX2PzdYQMAnBBqW0LKNgkKvm1o3wS3/tpBJNq1p7TaTGs 0E3puBPEoanayMA== 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-20250127_044645_806531_0B2B0651 X-CRM114-Status: GOOD ( 12.85 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/ahci_platform.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index c18054333f7c968cc4e131545fc3127f03ac27e4..cd5d89c1902fab6c936aa04eefb461c968726185 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -74,8 +74,9 @@ static int ahci_probe(struct platform_device *pdev) return rc; } -static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_pm_ops, + ahci_platform_suspend, + ahci_platform_resume); static const struct of_device_id ahci_of_match[] = { { .compatible = "generic-ahci", }, @@ -102,7 +103,7 @@ static struct platform_driver ahci_driver = { .name = DRV_NAME, .of_match_table = ahci_of_match, .acpi_match_table = ahci_acpi_match, - .pm = &ahci_pm_ops, + .pm = pm_sleep_ptr(&ahci_pm_ops), }, }; module_platform_driver(ahci_driver); From patchwork Mon Jan 27 12:46:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951337 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 67BD1C02188 for ; Mon, 27 Jan 2025 12:57:40 +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=8oUDNS0fcrx4OaYIBd5riS15Hnp2550FLQmcgRsJgyA=; b=YnpoCkwx+i6JWVYS8MUGdlAe/Z v9UPuRdkCCLiwKL83Eiaa9VuUe8TGJLTkrYczKvIEk5j2gl0UnuH4cpN5WlEiMggRf1VZlB/I8hNe 722FUod6YFRwAuLbWrCRpsxO5+Togz0YAV7cUbnhGtVzqE3sXzoT3tH+aoFafDMjzdHTjppk7b7HI g+1u/pIBKpsM93cyiXU7+66G/+DI7lKvyjVDwWkV//Or6YkrknpZrPuM1ACPS5e2yCfgMVY1M9cuA 8V3BLyxW4sSKuO4ezS2XOfJbPo2R6JleR5vRfDs4013OZlg94e8osjkG0VjHD4olVVR13P9ff74OI pvGLrEVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOgN-00000002KDM-2856; Mon, 27 Jan 2025 12:57:39 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVq-00000002IIv-3IRA; Mon, 27 Jan 2025 12:46:47 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4361f796586so47707575e9.3; Mon, 27 Jan 2025 04:46:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982005; x=1738586805; 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=8oUDNS0fcrx4OaYIBd5riS15Hnp2550FLQmcgRsJgyA=; b=bqK3UsxuPMzntRVhNT+kZMUOhWV/nq+CUlce1sbAhhDUbyK6LBcf3nhwONWZ+fi17j aKFPjdpo4fATDRKBnMxIISc1KkM51pgUoA6h3Xf3OOlz0AlxnP2pCjqp04K+VdAYiEc+ yqM2MXIgvnBtPpPT9EvAJj1CSqua9RnA4OAY47KiECEpaleW/QJTCf5OnpFCOtJwHtWv jVYeQq72Z/q5btz3Q9BssNVm/6hoeO3XtId+QCEWBB8S8NWpOvnqx3WaSpRifkMPWofO Kogk0KnwSDhE+Rn06xAtG1imyfnDGbW58dh2T8WGZ9VQACMxQOK9nBDulSjc08ON2kdR vWSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982005; x=1738586805; 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=8oUDNS0fcrx4OaYIBd5riS15Hnp2550FLQmcgRsJgyA=; b=FH+tq6LF5iGDJO39HL/d5VQGbUAGWp3DxG3Q0psOS2W2EW2esmvdMtXTCkq2i3LG/T p8jS5pVQo0HQCygFd8nJ7d4pi5JGWI01z/TLXij915UYIHAEO/Eh49DUD2HaB3AA9/Zj 9IZUA3tauh6hVrvJ44xrTBpbda53cGiYUCTPjd9oQXJEFRszS3PLndJLoxUTpTAfVIzj Maa+PBLrzY4PptOGmNmKmj2tZQMwqvvO9MiyMaUoJE7DAu1912fYNaxJPWJvT4DFRVE+ OU2XNl+cQxnuQwZqRKVeIzR319XGAtxkGD4Y8XfonFLDPQgyhCpWrubHbV5KfKdCwZH/ qMyQ== X-Forwarded-Encrypted: i=1; AJvYcCU+Vout+YlTsF8YcHPv7iu7ap2O2OhKt18h3Hm1H4eqABVNStkb0xMdHW/uJIPACTbewJIpQF4gTRycSIrCbB/O@lists.infradead.org, AJvYcCXuRBaNFv2oFnaRvmjNKDy9OuN3kFAsNNODG0Z2F63a+TsITFM6SAMPDjrwgJ4rCGYgu9kBUkBJaryVvfwfvWQ=@lists.infradead.org X-Gm-Message-State: AOJu0YzYaCVOtq14laQXgpfjNON0ywgxu/4cFRQQjg/pP4aPJuVrQIin cnpZqxKQSJ3OnOUT+6w925l/UAUjNIEuUhJTKpYuftWnIix8/k8G X-Gm-Gg: ASbGncvqyPgTCr9loljn1wk5cLPim/4kQLaIQdVSu/cDetITp1agtY7wBIyYHLD4UuF aX+Z0NG91HubJDnBsL3G41jnsOe0UZHEuYNycbU+QAHwP3to5p6XYpsNL/YaOwXhDmXBBJV8s9O k2Gzq0QPOZLJn0O3cmX1VXB++QxCMTxM8qCMKioZo4nT1UusuLVdpS0e35PX9aSOFMMs+9m5qcI /08wnMSm7cQlYFSpBR/pg8KYsK16sV+ZM4j1tU+L3ZF5gH18gTPSzuShSqZrHkgiwCOtXDcN1Sn ORV/ X-Google-Smtp-Source: AGHT+IGGlOON38G2cwVHy7HWLqeoiprbbsYzb+R2lpZBxzMcoaBGttOdxBgPJKnbhKhubtPPASJM/w== X-Received: by 2002:a05:600c:4ed4:b0:434:f586:7520 with SMTP id 5b1f17b1804b1-438913c5d53mr370329335e9.6.1737982005060; Mon, 27 Jan 2025 04:46:45 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c4212sm10639980f8f.87.2025.01.27.04.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:44 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:46:03 +0100 Subject: [PATCH RFC 08/14] ahci: qoriq: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-8-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1535; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=BVe5T/T+KyUbuPkxpZh30Ji3hdJ098Bkd+OSL6K5mXQ=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4Ar/8OCYLq0jyRBQ+Yjy7zx+LAyAdn2J69PD 7OGj9QKt02JAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eAKwAKCRDnIYpo1BLC tVr7EACtsjKfesgoSAqC8UkGk7ueOpe82d7ckBOhdbGJnRi70fcUJQSY/kkf2Hl4t5wHe/cVsw/ vS6zV6opL0l5hPIDzCGMq3iWUg/vFwAvE/v8B1UR/yGTY2Bw++rPjRHqaGM324LXK4iroJNLFED 6uknhnXagzGruwoKVaNdHR2pDsajddGRtyos06fe2FDnaD9SEajOqAyL42qE+SiXTjK5zKoGXYC +BDknQG7waEhlDM1cQbUOIS+C1hfS3mD6tfgYBVfg3GZ7sWUxMX36hAKZr8bpChDQf/OPg/oziK GvkrPLOT9nGptYxN1bVPuy+RkXFAIEKb6MAC69msd6BhCy8SWKuLiYs8o1VLqYMXVOtsR4hOHY1 Ijzl8dBxc7zrV6+WoWyRYJX16A59r2Tvn+jxdIh+/ZKtPJ1MIY9o51uahQXNsF2j1aZT4hQzXzj 0p2crfx2gWw2Bpv+qSu9O6aEqupWvQPhwYT4sgNwrAfrAXo67VlhsIH4JJnSZ8LBUjEyJmqfcSN dPV+nN0tafh4c9lsamiWYfZcYj8FwEDttEUyJ0FLlVUwQ7RQcCe+ucPKcOWlT/aB/GcMUDHHo/x hTUM5LB+5EnSwNbvi4q3t0QvP77e4p8gjbIlgmjgEvpgcu7yOkvMWVxVeFrfSuVUmnQa+cvQ/Od MEUGJsxlPSjYVCg== 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-20250127_044646_829992_10D77151 X-CRM114-Status: GOOD ( 13.65 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/ahci_qoriq.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c index 30e39885b64edf9cbb1eeca853659582f5296361..5f64bb8cd2e9c8d34403f76e5789fa435dce94ca 100644 --- a/drivers/ata/ahci_qoriq.c +++ b/drivers/ata/ahci_qoriq.c @@ -319,7 +319,6 @@ static int ahci_qoriq_probe(struct platform_device *pdev) return rc; } -#ifdef CONFIG_PM_SLEEP static int ahci_qoriq_resume(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); @@ -350,10 +349,10 @@ static int ahci_qoriq_resume(struct device *dev) return rc; } -#endif -static SIMPLE_DEV_PM_OPS(ahci_qoriq_pm_ops, ahci_platform_suspend, - ahci_qoriq_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_qoriq_pm_ops, + ahci_platform_suspend, + ahci_qoriq_resume); static struct platform_driver ahci_qoriq_driver = { .probe = ahci_qoriq_probe, @@ -362,7 +361,7 @@ static struct platform_driver ahci_qoriq_driver = { .name = DRV_NAME, .of_match_table = ahci_qoriq_of_match, .acpi_match_table = ahci_qoriq_acpi_match, - .pm = &ahci_qoriq_pm_ops, + .pm = pm_sleep_ptr(&ahci_qoriq_pm_ops), }, }; module_platform_driver(ahci_qoriq_driver); From patchwork Mon Jan 27 12:46:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951338 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 72167C02188 for ; Mon, 27 Jan 2025 12:59:02 +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=EXNi3EOoOoj09C+mWJNSCmBp9EDVd6qCUzZ8imkNOb4=; b=FAjCkNRSKvld9306HALNuh7rBi SJNwTJrXVsHeoOA5aRDxBnn1DvvOD8NfLcfMWAdGGSWVCdXw9DiWdCKYAX5xPzEPvuXUJDYLPYp6+ sT0NLMFyT0VsaP15nnT3W5ofOzocyAFkM+A6muMIoJdi0ufdqEhM8m2hTAvLl5C+yiadKu8mxF0Ap oFvyMr2ML9VsMwlQKtVoeXeTVAEFGlAw48iKb47/inj7RKXbCQkR+O0t8FrWczH1cP/ZSNbbfTzwb DOyW9vMsl6xRiGtYkBfHmzW5UZxfJJ64JK6Zk38HLqIGwjiYJW3eZP444xQvn0j4I2MjIlj6nYOQH YATlXHPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOhh-00000002KKe-1sGI; Mon, 27 Jan 2025 12:59:01 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVr-00000002IJd-2gz1; Mon, 27 Jan 2025 12:46:48 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-43622267b2eso45486875e9.0; Mon, 27 Jan 2025 04:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982006; x=1738586806; 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=EXNi3EOoOoj09C+mWJNSCmBp9EDVd6qCUzZ8imkNOb4=; b=Keh0wHpbMlIST2Q3b7j3F0Rgzuswtcje2xRPN6eyNJjkftkJfkuZWCBLBwH1vJT60z YAgydQuZ2GtFQs6egLVUMzcMi6DnM0Q/ENRYD55vAZJScjKLyZAcTvmDuXuui6doRCVB fgv4DIgbSsnAi/p4dZbEb9d27UooCCn5qVQcl8MzqYemljYEc+zTrF4ZO0UCZAzbNhkv mVIf3wDe/SxZAEflAuxxL0UgYWQ7YP+ZYDsEOGvzXqFAhT8AY/p6BsUx5agxuUiARZ1B lLAKJaJ5FsZt3iohzvmX6U/HqQQYULyik/GozDpVCPOxZjXiNgG8nqH2WmsLZKip9m+N OhfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982006; x=1738586806; 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=EXNi3EOoOoj09C+mWJNSCmBp9EDVd6qCUzZ8imkNOb4=; b=Zvy0JMjSHbSc+73m5s2zQZ4+ban9Vnz927Z8s2C1BPKHdIshh+xekAKzwOrk0ADYbt aHRWpYGajePOqGhmhicHTL47ObUWOOgSfLsITURu8nQ4LAmoXSeC4Wk46QW2w2HbVovi 9ZEprDueF+EiuHCpdwaM2jcbOGNcORlgD55W+pENqsvDyedr1hLVRcGApkD3el93GfDo J2zBsWIZgftO9rZDpslA3oNEjOhi3nogwLSvmSJj/XPmvRsCzW0IgqBzIP1yqtkfWKPG /sW+spa16M0nbBPqY52dnBSeAW61CLO9wKv/cFvpZhk5UWtxl1PUIkgOgeaq8/FGt+/r iMWw== X-Forwarded-Encrypted: i=1; AJvYcCUkbEz27fbOUBDmLW031OTvPdRmi9am7bT6HCIXq72PHeq3YBIHaZqP8AIxX/XP2MAseHUNjwStEuA3cKoQgPU=@lists.infradead.org, AJvYcCWigm7nrCfk/mypFtJXO7rm6Wm5dVrS3JviqA0uU9JoC1QqC4jrsEkGg0lA32CZPSvfJD1k4TNAJ1KIl2wdo7rd@lists.infradead.org X-Gm-Message-State: AOJu0Yyh66KpggSOieC1YSm2cZbObphX9Zc9834w1kRSSmRRbQwklFni U2h/qzD6Kw+e1ZrkQQ/j3ryo8XbnmrKFpcdXkLh63SJyg0B4zJ9t X-Gm-Gg: ASbGncth0bvD5VqyU3QXHKxwioxY/1LCURmfTiS4KZDk47DX73xjHgl1GYb/VzxPaxs e5E+aD8X7tf7GWlZvjzw/lKH2WdDOzw4nx4KO/PqCXWgdWw2EnEsdzyC7/Rpjtw5UD1fhWl5lw+ GaWgGgRY0AdyiBTCzk2enBWIodOB68Hcs98P9mf1/K5DQ/BkECKgrlly6VRcZqqYkNYciXE3DrQ EIjfnEI+bKnWaeJj05K4d8fgg3oa87SvdYy0MY3nUL+q2BIQ0ot5FqvJ3D3JBbvpDWudB+G26GZ avAp X-Google-Smtp-Source: AGHT+IEAjBouqDFRRxREIp+llJfmCSrig9ltB26U/3ZnCQ2AVFGrx3mRWJPMehdo1wr/ju3fkhOnbw== X-Received: by 2002:a05:600c:a45:b0:436:faeb:2a0b with SMTP id 5b1f17b1804b1-438913e32bemr392457615e9.15.1737982005836; Mon, 27 Jan 2025 04:46:45 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4857b8sm129474675e9.15.2025.01.27.04.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:45 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:46:04 +0100 Subject: [PATCH RFC 09/14] ahci: seattle: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-9-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1260; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=4ewGqTecw9fB2ZWQrXC3ww6+O0Pce0mhF6dQFMkMaFA=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4AsXoc9CTFQybRCbZpaLcS7DyP9PPRpr3K/f 7ALURRpv46JAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eALAAKCRDnIYpo1BLC tcAeD/4+rRt217wlEAkj+zo4D1LMo+fJcoATk6JOdCwjeGtexKKz6F9bpW6+T9FpMEJkOyevd60 iaqxz3f/TQ6Kc/vLiCrfAw02zyzvVW1bmI2vr6XRy33K3GYx65AN5MzmInaKwZuP27yx3FoCEob Fq84oTZcaoRCOteJdcfabhn1WzmnWa1bFqTVInQ8rrVzds723AZtiJeU2MCURZaofqq6K2DEFoR 6CBVFgMGxgQuoDByUrb1SjmmissVuqdRtPQYnY4w+7Lb5CsyVNasfoa9IzmEpYFj07JYeqr8KVF c4wIM1JMg15XUKNN7Vu6riEMnpiQJePD3TjaSjJziXPkCw5+LATokEW01/ElnQCnqz1EPKSwk5A 7cTrnEAdX0Xrtu911/9qHXoi490oklQqvbkcs4d6rGYCfn0dyRBAEyXhgK1sFXGjFg4lahWO3AB E0uEEl3kf1fg89jgW3cHATh7pSdhxuVO02VKELQS49Jg3XBSvqHDsbk1L/dSuoGig44rYsLnGMl J9rTAyJzfpdbcjtzhyLeej+OkYVXhXluhO/C3/gz+C8nESIR9+rKjwJv7yPz3VJkdveQRoLj8Ei clkKmuOelYUGxSjj8X3LxYfnNEI0pkLiZ5bdxTdrlbUKRiPJ61CB6WK/cwmunp2Wt8p307RtmTA gS8bW2aVFjdIBWg== 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-20250127_044647_688163_AF4719B3 X-CRM114-Status: GOOD ( 12.97 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/ahci_seattle.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci_seattle.c b/drivers/ata/ahci_seattle.c index 3f16c167840222e0de935f7fe44b3d83b95bc16c..4b67f3aa5787de433c8bcc1bb4965a887709aa9c 100644 --- a/drivers/ata/ahci_seattle.c +++ b/drivers/ata/ahci_seattle.c @@ -174,8 +174,9 @@ static int ahci_seattle_probe(struct platform_device *pdev) return rc; } -static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_pm_ops, + ahci_platform_suspend, + ahci_platform_resume); static const struct acpi_device_id ahci_acpi_match[] = { { "AMDI0600", 0 }, @@ -189,7 +190,7 @@ static struct platform_driver ahci_seattle_driver = { .driver = { .name = DRV_NAME, .acpi_match_table = ahci_acpi_match, - .pm = &ahci_pm_ops, + .pm = pm_sleep_ptr(&ahci_pm_ops), }, }; module_platform_driver(ahci_seattle_driver); From patchwork Mon Jan 27 12:46:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951343 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 7EC25C0218A for ; Mon, 27 Jan 2025 13:00:24 +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=szGjXo1hYYSzRkz6HQhU4uZSzD6xW5bFqhnvJ2ebtpA=; b=h0Jd3sBrBoVRGrtuLKcivI2mdG 3QqkOXEPIWZbXJuQxX+S5V41L6XYpvnPJ1eOdWAUF9dYqoWWVhTWe+VE4RAf3WFHen2PKV6tvYMsC Yy/JHwvdNbfTlm8xholQr/gGGaR4v1O/iW/rpnTSKL22wvofZEhkOaBBhpXlypiFpFwhb2cYLVMLi TnBv2LBKUceof+UvkI4JHelYyE9+zy4hBovMlD+QDnmvDfmZyjv/lmrjT0+2KqJl1CeCpz+xIHyu2 4wu2Nnp8Sr9DgE47AqOrMdg66928PYZ4zhKBk35qo7607jG1oxchQQxsUtnVcF6esN2/Qn3SxJDTo bPoxEyuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOj1-00000002KVi-28Ja; Mon, 27 Jan 2025 13:00:23 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVs-00000002IK9-00qw; Mon, 27 Jan 2025 12:46:49 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso28267265e9.3; Mon, 27 Jan 2025 04:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982007; x=1738586807; 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=szGjXo1hYYSzRkz6HQhU4uZSzD6xW5bFqhnvJ2ebtpA=; b=SdT+59+dvWVMko8Ljo0CN2dI4iLpgDSNGR9Pwcok05PV6khXVd4rJ3X2SXd0iLFTKS hhfWLUiPOBja1IOy4WpR+2dthvWwj9R46LldgurrhShWYiHjcgTj6UkiRPlBDDLsJmGU AFaUz/XvB5ZOv9s4xwDPMhJG+g1w7jQya47pC7WzfSNFbNit6k1amXa6CIs+2c3mvYgt IYRA9hesybn09iHXVCajGjkez6vLFeb2lL8s1Dtw8tAvaED++D8ID5CUXRwciwBUSsd3 CWwXf4oW0GugO8iCrUYJB1wXMg/8YfinxZUJLwkCegQT1unP4FuM4fOwzmsq5qZmIDIn Doiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982007; x=1738586807; 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=szGjXo1hYYSzRkz6HQhU4uZSzD6xW5bFqhnvJ2ebtpA=; b=WbMBJJeWiuleN6cTRNtwxuQpqz9vHBSjUulZnfldwOnoNGoPCapiESgkgVBjQEKGSl eika+D9rCLMOEnr9Z0oB9/4Asv6ifRqDinoHNkt/EEj/0zxhF64ZC4w1kHWjyS71JKqU 9dVeGYPYccm55yOcKOC3b/FiXuwsdzsgwO4TxdF7GWN5W/p6JK5+K1jxd5pxkW08Ew1F yKUrvwl9uX5J+G6T2XVgp+6khtvim52aT0hQ+ZhK2xxEtOaLIGJw8xxwuIo7DptHiwl3 hV+RkfE4eTG1YF77OOzT/yDiJ1C/ea669mO9Qts5Ec9Vsd4REUueyrlZV7kgvvPp7gnV 1REQ== X-Forwarded-Encrypted: i=1; AJvYcCX34WczbqnWdrPzG9LajsVg+xDYwQSGwvh66XgyTdH8k/MApftD5e05DCKf49xwXcUiBAAuKnf+FWKAduLV0k4=@lists.infradead.org, AJvYcCXmeUr1Y8iBuNybb1PsYiDM8Ue0M9BBTZqwUuUcwzonzNwS7vxQxZDewv6FbRvLm1heAX9R48CrHfFlPAFcZG2q@lists.infradead.org X-Gm-Message-State: AOJu0YzTjrzv2WzA8XTlo2oCLFbnNaVIhyLNCBfcyku6/hgIUrevqHzD KAvtrpihAvjQS1bZDevxH6/abCDMMegyKN/wK3iSqwzF1P/MEhD2 X-Gm-Gg: ASbGncvoqCq2IePmF4zsgXMeIrsr9l4o6TQoEr4akUjmp6UjX8zyn5sX+IcNkQ8X6yZ +/bVzk+e3QJVebYHszSqgDvIa4EkZkGxvtwt6l7u6XeA3vFp7OZjOOSaXV57G4QqQKCGloHxKjz B6la8m8jQaKgJg4YKZ1tVRDouBu4Ofk7TlqG1qTNMpPqPhbhfP+lc7/NCQcxTrP8AmSP5r/bwWp thlkczkOy1fFBCAPFQUf38BOsvvAKsfFxAwQhjwTyeIYY3oEwr+izEk95DRPqeL9oc/etKbfgKW SuZV X-Google-Smtp-Source: AGHT+IECyknYFtGMyIOfytVXp9Xpt7MbeLa3f0kkvjGmlt26TzZXV3Ltntm5/VpvvPJ392VzgHnZnw== X-Received: by 2002:a05:600c:34d0:b0:434:fbda:1f44 with SMTP id 5b1f17b1804b1-4389142e805mr342800575e9.19.1737982006564; Mon, 27 Jan 2025 04:46:46 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd501c2dsm129180725e9.13.2025.01.27.04.46.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:46 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:46:05 +0100 Subject: [PATCH RFC 10/14] ahci: sunxi: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-10-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1570; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=3GK2SPKfq0gy3cNILmQ5ZsytwY/PBIweFrsBnfiLWdw=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4AsWF329QNvB9AQN3sovNUKToG4hfpVVUhqI R8eXTifdn6JAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eALAAKCRDnIYpo1BLC tSFmD/4tt85mOkwMLGX8cjbjVQfnqOnIgtb1Q2GzEesQ9yxpXI88g4suta0w+UhJqmL3ItTeU1n mnbBJgomCc09suTGM53hvjh3KcJfiJa67PyOst0jpmBJ5vxiFLSxQRlnoSKy/R2IwZ8/SpPOVod WhvficTrwmPfNlOEAMkbaa/3zdLSkZlYsMfRf2Ociw0zcIKLyvlfWWp0fmx3BjmxKmJIGKOL5lY bpU/tz3HDN7BFVy2KKTbpF/I8bOlnD8ZDknqqsSACntMBhStldQI7soe7PfP4dO/BvcYuy1nsXH VgGEHYoiZ9i7HFcP7rWJXIe4CXSjPX5Xxl1R2fvT1328vP+dXS3xfkW850n1XvZpYLdZe/43d6a PnrMCMRbvxYzpXmNWYsQMDT72C4URY2EBSKf+8huJrX61vLD2SlDOsPC4W8P3z75oYR+3VW6e9y L9OElLjmtRdv/4z6x+QN3Xo5KYnaj7NuFs7B3TWjTtrCzA7SmEEwCjlY3BtSSdsDDSGiHfNpFWB BqHw7DRbx+ANuEbZvr76T1jgLWfdW5054V/UfJEm12/qGHlE5Mt0FIOLGx2h+rQUktRQn7zlTIg im7n/LUh3BM3zBhUVD+w4dSO/PrVycnDTeHnXQfXKYImu4SMzda4AOHhw3KZGew7PY/cYjhJMFZ /+uizNvy2xVE0xw== 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-20250127_044648_056893_DE532063 X-CRM114-Status: GOOD ( 13.89 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou Acked-by: Jernej Skrabec --- drivers/ata/ahci_sunxi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c index 5d4584570ae013a4e44ca69557cc2c5aa61d32b1..2e86d4c97b822b6a52513dbe55e21851a58385d9 100644 --- a/drivers/ata/ahci_sunxi.c +++ b/drivers/ata/ahci_sunxi.c @@ -253,7 +253,6 @@ static int ahci_sunxi_probe(struct platform_device *pdev) return rc; } -#ifdef CONFIG_PM_SLEEP static int ahci_sunxi_resume(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); @@ -278,10 +277,10 @@ static int ahci_sunxi_resume(struct device *dev) ahci_platform_disable_resources(hpriv); return rc; } -#endif -static SIMPLE_DEV_PM_OPS(ahci_sunxi_pm_ops, ahci_platform_suspend, - ahci_sunxi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_sunxi_pm_ops, + ahci_platform_suspend, + ahci_sunxi_resume); static const struct of_device_id ahci_sunxi_of_match[] = { { .compatible = "allwinner,sun4i-a10-ahci", }, @@ -296,7 +295,7 @@ static struct platform_driver ahci_sunxi_driver = { .driver = { .name = DRV_NAME, .of_match_table = ahci_sunxi_of_match, - .pm = &ahci_sunxi_pm_ops, + .pm = pm_sleep_ptr(&ahci_sunxi_pm_ops), }, }; module_platform_driver(ahci_sunxi_driver); From patchwork Mon Jan 27 12:46:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951344 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 E414DC0218C for ; Mon, 27 Jan 2025 13:01:45 +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=KyTcZ2hwVqzXcvZadTxLwsKyE/CzZeUWttlSS9sOM8o=; b=tW/liwwCBItNpbrHOzkAo1SZnc D04b+4cf7u09cBiSyAPG7LHvBgfltkAgcNmVcQZVwBxJD43vcByydv3NQWxFCP68/Vhx2O2iIdGc3 PW7B63Mdhpt/7t/WIyvwxEuOvcWRBIUIKZjf/I0yvXZAPWgF8M8sxbBbBN5b6OCFt4A+ZRtCu3Sr+ uZwbymf1F0BTGkER/GQimH67yknkAtmswBkTRtoDbChLbckV5FjzwwWyAGN0jN2g4CEwDaHyHtI42 6yYAiXISYGZ1Jp/nZynf4vCXIuQ+z+BBsW4DSoOoryW8OyBvE7nV5GgA/HP01YK4Qn26rhSsaf37o 1N7pU6Hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOkK-00000002Kd4-3KCH; Mon, 27 Jan 2025 13:01:44 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVt-00000002IL3-1oBh; Mon, 27 Jan 2025 12:46:50 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso30684235e9.1; Mon, 27 Jan 2025 04:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982008; x=1738586808; 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=KyTcZ2hwVqzXcvZadTxLwsKyE/CzZeUWttlSS9sOM8o=; b=O+QCtk9ZIs/re6mTlhtElwQtxHDEawAj+o+WYyvPHQFBbAnRSIzzQ2Hu+4e4AfY1m2 HaPgffO1sZJHfUv0IosLF+mZ61kC3qNhLTa2f4izM/N3o0PAmTptzWZsXiRPF3GFKsQ6 WbYmvHdoHOY+FrgRuz3dSVtY2tgLzXniHLH50kVYFKT4JxNpnVmMieYFPkJRJGfUGEcY iMTFummwV5J/ehA3iZvPHktJpCaWOT2wdFxus6kRsMgfele4MpmgTmlj/+PvxtfEm2uJ JUlW+k8j9V4vPrkO95n1Pkb5RyLppD1grz5rUu6BVicugMGCEud3oyZpcL7arT84yIm1 Uezg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982008; x=1738586808; 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=KyTcZ2hwVqzXcvZadTxLwsKyE/CzZeUWttlSS9sOM8o=; b=LBFzYWIwxTTHAxUEYvx1Y5ZEU2p2yEd7NWtgpmU5o+gcDosZSi5PKxIBDzKjWotbO8 k/Q67NuDehJe4hMaXOuK95No52LQoobLsjhqYzHruyXJSGoDvTHbr9xuGhwGPiaw1mk1 ZVTxp4a6IyKOhIMhiXRu6d2UdOPBSJtY7Fidvrryno+URXbzP5XO90ADPxEDCkPYvIzz MFSHcmyYJ9/2sEVthvbFHXlhahC7OGrXDMbegMvluH+LPYS4z4KzTT23qSrGs4wxcVcF HKfqyzWDDuPa9WizKfleUNDhjpXRCJ3XVLDGNf/JHOi9aHaamvmK3lmeqLN9EmItwzoP W41Q== X-Forwarded-Encrypted: i=1; AJvYcCUp06r+Me5r/gAPhL+fTa4wsBO+zVHMO8tSF8h7p8Osgqw8qCWCBaz+Tvdszy2wkT7wgnVoR5MBHwQZ/TMYdyuE@lists.infradead.org, AJvYcCXsJrgqTMmgZcqFPAIXUslAzgVjbYaPCqBbAnGa5AlE2AR7AC6OvFBbA/iveSCMWYoPDhQtQnOyg0gI8Fp059Y=@lists.infradead.org X-Gm-Message-State: AOJu0YwU4RZ8YPGi7c9O27JFTwpgupsYbn3hllKPS1P/SAwg7AtpG946 QuSc/UtAGCM9Sjci6QBjpLNvhCNgwsEjGKR4vfFOUll3GUXMn+tk X-Gm-Gg: ASbGncv4kYGtY8u7Q9DDILV/EmgGHxEp/6rZlT6hzO5Bxl1a21weCWMiUikc7Fpxs8T MuRQvHZVE3sfkqHoWBk/zSyWdC5SUA6AsHf8yRfQ+mpRV83905jgTP3L7Q6/l+HSWPoiyMcwanl YRRoQ+iD92hUeSnqOsdN/mAdTi7G5XuKDVW59jYTTWeNrZqSnR1Q3FDYuWHat1v9rgQCWN0PWwh XRiGiaDKENhPNZk6zHCdqz0Rp1eg3A97FZ8BTxcwMf/PJhsgFyeTl0g6fH0QcO7xgzNE743kpjr Q8As X-Google-Smtp-Source: AGHT+IFg//5LwYfTEQFnuSRS+BvJlK0U1CIpZoSn+yBRmJA85z19Z9oAChFCXf49dqnRysAazQ+L1g== X-Received: by 2002:a5d:4f8f:0:b0:386:4a24:18f2 with SMTP id ffacd0b85a97d-38bf566f3d7mr31426711f8f.25.1737982007652; Mon, 27 Jan 2025 04:46:47 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1764d3sm11150284f8f.19.2025.01.27.04.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:47 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:46:06 +0100 Subject: [PATCH RFC 11/14] ahci: pata_arasan_cf: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-11-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1488; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=W9yVEdw4qSI4n7OCj5u/OGHoNGxhi+e4Ou6sa0uyD7U=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4AsXHhQC6f7LA3oB6K4p2SmmbhUaUWGrqpy+ 0C1WwXAqe2JAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eALAAKCRDnIYpo1BLC tefCD/9fpGNoUqDi51K2tB2D9CFl8CeeHTF4pr8xRoOQ4wHxFq1j34zFjU0zF3FMPafOKzx2ZpU M0H+96OFbAZFRVUbx4TMhBAUFbWDJmYEZaD37c+ZiNhwe04QMF5xjCOdcOzfOxq20XK75ysaLym SaEYxQu2bvz+1luQsRFAMDy9qgE3lU/RwHZX4Fnoi+LNBgCnzFobqD6AcCGplQY5GczK23KyIy/ Qnsf/uNpvh0qhLhkT9z8qojEvpxvy0B4Gjbrg/7C+/W16wnfh6q4tPxknNPELUPgowGCKyPBXMF N2H3TS21r18cdyWUIRFdZQyKfD1OV7qvTeVtnZKZKJx8S0YDBEOafcZmRlXuFLUlOOikIvDDfmy 60XDP8DfgiBRt8SNQMvttfg5JDwQ06nB2k5WmpKgJKIaH2Isb79axwMaocq7jKHGJ5zU3EM2LKt P1CSwU1T2RyRAP2moyDlxIQWHKwt7l6spquHZS/azAm9qYKh7V/NjXg9ojMSyKAsxzSieNlYfi9 RrD8Ciy49bQb8tFtcEPD+4NAYZxTqA+rQL0enjR0VFqy1U24bMwVr3zTYFYzUNtPBruiDyS6Ihl ZS8SJ3BU1M8Kn7kD1mDYNNod/D6qYBF9ziEv26ZHOM3Irpk2//In81xjJi8n2RRxWRWc32SzYmY kSDFGSf9UT/2Vqw== 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-20250127_044649_471247_62E943F3 X-CRM114-Status: GOOD ( 13.71 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/pata_arasan_cf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c index 514d549286b56eabe07dfc2b3a961ef0f7c983f2..3ec03147a8fbe30e9f82c184d7a9c32cabcfdb92 100644 --- a/drivers/ata/pata_arasan_cf.c +++ b/drivers/ata/pata_arasan_cf.c @@ -926,7 +926,6 @@ static void arasan_cf_remove(struct platform_device *pdev) cf_exit(acdev); } -#ifdef CONFIG_PM_SLEEP static int arasan_cf_suspend(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); @@ -950,9 +949,8 @@ static int arasan_cf_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasan_cf_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasan_cf_resume); #ifdef CONFIG_OF static const struct of_device_id arasan_cf_id_table[] = { @@ -967,7 +965,7 @@ static struct platform_driver arasan_cf_driver = { .remove = arasan_cf_remove, .driver = { .name = DRIVER_NAME, - .pm = &arasan_cf_pm_ops, + .pm = pm_sleep_ptr(&arasan_cf_pm_ops), .of_match_table = of_match_ptr(arasan_cf_id_table), }, }; From patchwork Mon Jan 27 12:46:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951345 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 E896EC0218A for ; Mon, 27 Jan 2025 13:03:07 +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=2I/g6DzNEY6MLWNE45x2+A3Pg81FAkaF8xBvQmIiUUk=; b=0Y2UCPmXv7fIvmxk/8vtGSjiSG ix7Ngu+WaQoWcnaEBtxNCsk+D+Ly4epNh/DVWiLa4SAGIx9XhlYWkF/x6lcPRm8Rwd8w5o8AbFQIi KIu2gq3sbs9kHQU+sUJa0Wm6Dn8ruvPgV0Z8ISF3WeiJXofa92TqDAvRC71MDlXW2qoVAgO+rH1FG 6S/69dtUWhCkske/TNNYuBaylex0rBVQYlZbcZPJ/YngnaSF0yH2fM9BGSVGt5HSr0X8MAqpld/S+ E4ByiucLFFRux7GiC39Lr8ckSVsUKEKcSg5Jq1OM20YK9gMIfvMNVlt0cK3GvAgNVeEpW3HBA9hyW 0eF2S3nA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOle-00000002Kjb-3kCD; Mon, 27 Jan 2025 13:03:06 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVu-00000002ILl-0zGi; Mon, 27 Jan 2025 12:46:51 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-388cae9eb9fso2532843f8f.3; Mon, 27 Jan 2025 04:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982008; x=1738586808; 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=2I/g6DzNEY6MLWNE45x2+A3Pg81FAkaF8xBvQmIiUUk=; b=gvMp4eeYgAArYEagmzjg6LphvEJiQpRWzKsNQ/I8YjFhBv5odPTZttmeHBKtyyWE2T Yauelc4aLqkayeBb3TZjKDWmzhj5aqueRZhvmM7v/F62i2qVtvsDX9hh3eVXV3VJnIWS e5HlDilDWBDTFfUxgWbSZmDtEZ0kxfAZPZFhdD2kaRc3M31P///dtnplQkLffQciQPcY Uc0+kMloHUa6cSXeZhH+Y+AFHpKnRrjDQ0cFj1CdJ22eAm7METdtAepKNytNXYU/DrqO U6BhA0VlO0jHGhJlssebcdEISYDTeT2eZ7bMAE9/1hhu8dlpfHhVqjpkP5QBEZcVmzsk BIUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982008; x=1738586808; 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=2I/g6DzNEY6MLWNE45x2+A3Pg81FAkaF8xBvQmIiUUk=; b=cWM3mshy7hV0LCu5JU17QY2yTtZkbF9XDghDFJk9dFxKgkYcsTtmTVztftg4d7gbVZ lCsNelSGGaZ6c6Zin/cHUz3SBowzqoCOIXIQ9ncZjkL1nQq2ohHzmTVWHOiK7+pt0tW5 3WihsXyDLwHPBweEGDolVEMLIkgaw2Z8rG5YTvL09rxcJlwua9LtPKQcNqWrxi0HQqSj rbUEiyV4tVBlSDNS6SZKzLgAzoKykJX5C3mKbWDPCF3P1yUcezFiIBrF47atkbRN0rzR WmEH+kazloMQIkZDvQErz+6lhym9vcC0+h2JA6o08PZCuD2admPX8KpnUMPGY9D2FimK 3FHg== X-Forwarded-Encrypted: i=1; AJvYcCUBtj/Gb6984Mz9uzhfLWaTy9huEPv66LLUeIPuHF/k2wNTxh4feCk9UnH0XBvjFChCqMpXL8U9nOFRaQ2k7Ek=@lists.infradead.org, AJvYcCXYTThDEd0uj6RGes9qJHGVMvc6X52nDEBHNGbhefGSs7BR/9m8qGrYCnAy0QIqHxr/Nh2vHfQc0H2PeXAH/iK4@lists.infradead.org X-Gm-Message-State: AOJu0YzKozBAPU11NUZMT+8SuoOHyfPJqhSg3bJAs/zqmcjo7rPB66h3 I9ZrAl4sIlqFoy+9WtU0C7Uec4ezohLBQMt9U9mBG5IajIsrSyrX X-Gm-Gg: ASbGncthE12HWGM20+wJUyirmaTE4MBRTnUvTJQdXHIwOHzjY45bqXOK9WyUq1AG6wI fmqBzAh+PMqX5FSEdxe7Vmd8zxXddgmXF2r+TpU1XyZ2924luaO73vRohLTERhrt8aS4WCfU3D1 GZEhi4zKTInRNkrvVcsOVadnGCaYCFetx4E7oWuVld0+6jqW6cApf7m6c9aLEegLx41pMaPuEbM ux9YLPyX3kjJyxobLGdLQ9xRVr8YPenQogeKAgjPODXse7lhrqY1FOzvr28hVCzU+pbOlDR0S1e 2e6J X-Google-Smtp-Source: AGHT+IHsX9fH6pHzf3bCE6qbXfxbIlFTpPyDWWHgJOqmqyR1gPb9ILP3sU12vqEYpKUdafd4H6jDhg== X-Received: by 2002:a05:6000:2c2:b0:385:e8ff:b9c9 with SMTP id ffacd0b85a97d-38bf57a9599mr31959724f8f.42.1737982008403; Mon, 27 Jan 2025 04:46:48 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a176538sm10795823f8f.8.2025.01.27.04.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:48 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:46:07 +0100 Subject: [PATCH RFC 12/14] ahci: pata_imx: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-12-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1422; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=RduU4fzm2S8yXhoNskJ0+TWDY47QJ0ZCJVc8mKi6Q6E=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4Asu66s73cxW3afxzdcBdIOeskJ4QvLePjmL oaiUlkSOWqJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eALAAKCRDnIYpo1BLC tS73EACMRajQZc8Z1sdLWV/SZIXg7nYvK964ydiGMezg7pqnDcMaSYXnamkue4xk8YysWf76r6q rAIFBZxGxVa72BcdpYNyoxdGNBJ5f1QW+OTmmg9LRSUVFNAeA13SfgT3pIw7CTNB1dnliTzbSR5 GS4aD7UnS0Dh3GpOdzcGelDLJtR+sc/OXaK1viecqgLA7ZJ3++U/18rFhwQzukJSzGdjNkKaTse sxLzAtXw9ol/+193Zcxih/qbp72pO6avHOcSiZh4LQYHDSxTxQ1hdD91bLM3lx7CwuUU5SbCMqe EE4ztvnAjkzJrPcixcsE3l1WLe9bZ5xwYSGUj9Rdw46fwKSObdpfCMcZEoaL6lc4axzOoAxfDVU hCBda18r0bikrIbRH64hrz5s//Evqw1DgvyqglLbLNHTxkhXCd1ge+4KqHDqizV/kHtTQBzHdV9 Qq01VP9o4MFgfHJZmAFp0wHEmo3MlL5C9u/irRELaCBV2FXJ3sa93XxO6SWDALiWzv0dbJ7sXgL P/oB4FwJKL+02n0knMyZWDG0Hb4bG+1N1i7GipLIzXLx4YaivcE4dX0nzXPZWx0PHQrTcPNIeaX r+U1dlYiTSU4v+XAjGJTkDKy9N8YZVv4PJkrbfgrLQzZ0Kmxjrqu7nMTaeAqdUYlqeK/8YjAelw FUg+FQ0FzBVVD6w== 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-20250127_044650_278320_09AA5F69 X-CRM114-Status: GOOD ( 13.91 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/pata_imx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c index b37682b0578f48ea9d51a103d19e40fe91c4729f..533de2782c37fb21bba4e4b8361c48c0f2878175 100644 --- a/drivers/ata/pata_imx.c +++ b/drivers/ata/pata_imx.c @@ -201,7 +201,6 @@ static void pata_imx_remove(struct platform_device *pdev) __raw_writel(0, priv->host_regs + PATA_IMX_ATA_INT_EN); } -#ifdef CONFIG_PM_SLEEP static int pata_imx_suspend(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); @@ -234,9 +233,8 @@ static int pata_imx_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(pata_imx_pm_ops, pata_imx_suspend, pata_imx_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(pata_imx_pm_ops, pata_imx_suspend, pata_imx_resume); static const struct of_device_id imx_pata_dt_ids[] = { { @@ -253,7 +251,7 @@ static struct platform_driver pata_imx_driver = { .driver = { .name = DRV_NAME, .of_match_table = imx_pata_dt_ids, - .pm = &pata_imx_pm_ops, + .pm = pm_sleep_ptr(&pata_imx_pm_ops), }, }; From patchwork Mon Jan 27 12:46:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951369 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 C7A5EC02188 for ; Mon, 27 Jan 2025 13:04: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=VcoOAINXi+2TT4WH3C7O8RVypx2rPa3EoGFaB3IYNWM=; b=UfGfl5EnLsG4kMs565fMoQhfeS Ot+HzR4Go90J3Y40wmsvHIF4u1XEQATkl+UdRRTDbAZvP3xjEQUVLp06V4bPD4PekuZdcjZAC+TPT 3ES7ZoSFUA8eK+VSVi71ks/Lpvjmc1m1rgaL+LrzgN4GiMkxIPwfpx23LkrXSzKiFEwl0vZrRFLQ5 D6S1zhs43mzy6dM07GCDuyKAivZKbJ1ee0+NTO6lIA5GxrPhJ1j0BfLSbV9OxveBUkMp8J+k88f2S HK2FzShIFpmJzmwp2IcIbmHmVbRoWGilIIZOBAG9JH6rSXeEUPcLYBqPCpqTy6IkszK/w9XPGtnLP ph2WQAcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOmx-00000002KrX-3W8n; Mon, 27 Jan 2025 13:04:27 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVv-00000002IMs-1afo; Mon, 27 Jan 2025 12:46:52 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4363dc916ceso34004015e9.0; Mon, 27 Jan 2025 04:46:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982010; x=1738586810; 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=VcoOAINXi+2TT4WH3C7O8RVypx2rPa3EoGFaB3IYNWM=; b=kWBcOdMjB2WQ4V9yxiLKFd/VpQE8xXdxCYOr1otl6H/kuctQoPX0rWxGYwYQgLBj5v fCWcHaTkpR6m7OaYplkZj1zJFdmMWW8JqIllgyyWpPfFjwdx4EwR5viRHrwUBgdmemxm mfh7bvQ5kNd6u7TZs1FS42pGl3aTrkTMGUvVVJxzxQyXnmcImEV+k033HNFHvorYmcl8 oLzr1jEOLD9RGraSxUiL6V781XI4pi6Q31ETzqS2L/NMUj8ZxhgGthsV+8sNvT8Aoc60 8GENYc7et0PUVFZX9dzu5B+6zdwwUZg/2X6nMQXZJRUloFH90fK37kSWUtwG2a5T4ec1 ZU1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982010; x=1738586810; 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=VcoOAINXi+2TT4WH3C7O8RVypx2rPa3EoGFaB3IYNWM=; b=aJr32vFWPMCpb58JrQUcHB+N/a6l9Qetudoe9cQjl2Ish46IlDp/ZpHyRM8MBZs7kn 5i7T9roVJBQgEgTUGOX/8nS3A5DsX9pPygqKp+YsypjFKWs9kHIk/aTNjY2XyzPgDX2s OCgxCwEQWwSP6cLhqzYbdpS06H5Gdr3XDSA/Ry/NipKKkXTtGjBCaJsOKJ5VVEhKGcId 1dTDrVHB4naOj13+uY6nQQfEnT9e2Us58a5kG+k8SGpby665gp6Pec2sH6GsGfGhR48H fTMKGG/AzNDAh8XrWfH7gwva0a7u2+BislpgqbGEnIcMMQRnMsKz0f8+JHk8HNPcLlNq Tebw== X-Forwarded-Encrypted: i=1; AJvYcCUT4eLgdRPGCnaYexPPNRgPeXUxaZrPash7LWreJCq8xN/1Hl/PRKf+K4bT/fJrTs3H0aGdWJwQMitta/kAiHiT@lists.infradead.org, AJvYcCVuY9W2RcysvhzilOKr5Whw+Qq7XN9TmR+h/rMEG4SOKUsVgM6X89M3gSNXDfM0urxdVD6uFvYyVi3mIKt9eds=@lists.infradead.org X-Gm-Message-State: AOJu0Yxy9B5zdPYsIezWw8ZWR74SM0n+6oHFZcC48+1HdA4vroI5EfIB zmUxU6S6Ok5CtTLZUIuardJhWhYRzoaUsn1oj/BYR1GQSfesSrwr X-Gm-Gg: ASbGncuwwakh7424eU8cVYECEFVE6QvLiH/enJov1N7gVArwrdagw8VYNSSSOto6pUv tGI/gwUxiIoSqcEBLEBxbr92X3ellfauPDbwCyZ8sIDy4QUxjFIvOfVPVfqMZwEbwvIqvuRA6Cl 1gXaj3wZLduGExvWUmNXiA9Ejp1T1OcPgwb8w2boDqYkbSoyaOEMdwFbjcEIWyIlMVl7aMNwfPn JsvDqk8uOhaFyGflMOB6vNf5Pu4cXQwifhnVXUTJSEXZvZhn3ISdiZe1GeznPgaf4LX5OCK6p4+ TGF8 X-Google-Smtp-Source: AGHT+IGhmYg12Hp8C0sebLYNbpYEvgc+ZIGcISfxxuByIVWp5JGbDaNxubM4KFeyOPfLyoSuuyFpOg== X-Received: by 2002:a05:600c:4fcf:b0:434:e892:1033 with SMTP id 5b1f17b1804b1-438bd052fedmr122721625e9.2.1737982009910; Mon, 27 Jan 2025 04:46:49 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c4199sm10751183f8f.89.2025.01.27.04.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:49 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:46:08 +0100 Subject: [PATCH RFC 13/14] ahci: sata_highbank: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-13-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1472; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=1sjh2+ve+pLpl+qs4JFyeDCujvbM9xUUKhOAy+ucg7E=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4AsVMoZcFzlRd2JDEQ88PbQqwdNE+u1+HM/7 InzrdmEGLCJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eALAAKCRDnIYpo1BLC tYfgD/9CwqCJAL0ulfW78Tlar3+UngP9sSkslf0UBkWDJnt4X7LIk87zcfAI5d3iefV2cAxTmK6 ao6wf5Y/ide4fMP3fOjap2jpht64DGEZavpEL8GrI/Bo7gf2DlChRJcjBUsqxnebyIiPeS58kwA 4Ydddyz1Zp+F6Bqr2PqKRcpDrdblMuBUrblp4S6RITvqSIv9IZSBj8yLj2z/WfMhBaIv4ISIXiK C+n0JjmBLFqa7Pk7CSLczgOHh1qLfy60JwWNpIIZFmBbZONE1M6m2UZVNss/7xARXhfAKEzrx6L DK8pVWyDBJVOyvBet3rdvhuYkOqcea3nzmwMoZ0lg4cb6fBT5cUpo1bcyt+E/zs09IfK+sNOoGa iDWuOLdAluiRBtMpbYuqK/ldHaIkS8ranmgpAtvOTHP95HRNUuaMJaNz2oHDqrNFJ8oVLbIC7UT CNgM6tRXgfLK9nXJ39KBzBHAXflILB/eoTLEgykEpIctgdzntr7A3xjhnHFlk93/KGogBdIzft4 PgQjO5+3/+TzxWIlVGJv7uUky1Ai0/n6KWK33bcRt6qpdzx+EwZD4/lwARWR4W6PO6E0LvwEvBo gHHRkONnnXc77U0KFLN01MFF/quoo7+Cj09FU+f4Fh5Yxil+Jsh5XooE0uhQRLYhEWxBWKPATpI QwAKsZ+clVVBIXA== 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-20250127_044651_460781_3523D9A4 X-CRM114-Status: GOOD ( 13.71 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/sata_highbank.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c index c8c817c51230a74df721016eb80238c188d96d01..c387e50485b974fa2f2defc0bd1ea8cd43dc14bb 100644 --- a/drivers/ata/sata_highbank.c +++ b/drivers/ata/sata_highbank.c @@ -565,7 +565,6 @@ static int ahci_highbank_probe(struct platform_device *pdev) return rc; } -#ifdef CONFIG_PM_SLEEP static int ahci_highbank_suspend(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); @@ -609,17 +608,17 @@ static int ahci_highbank_resume(struct device *dev) return 0; } -#endif -static SIMPLE_DEV_PM_OPS(ahci_highbank_pm_ops, - ahci_highbank_suspend, ahci_highbank_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_highbank_pm_ops, + ahci_highbank_suspend, + ahci_highbank_resume); static struct platform_driver ahci_highbank_driver = { .remove = ata_platform_remove_one, .driver = { .name = "highbank-ahci", .of_match_table = ahci_of_match, - .pm = &ahci_highbank_pm_ops, + .pm = pm_sleep_ptr(&ahci_highbank_pm_ops), }, .probe = ahci_highbank_probe, }; From patchwork Mon Jan 27 12:46:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13951370 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 044A2C02188 for ; Mon, 27 Jan 2025 13:05:50 +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=HoAOp3woacgQpHd2g/asCHp5UTA4pERK/Ity2Wb8N/Q=; b=Y0KSBLxV13vV5n3giMLhf68pI6 0TZCdyRho7FU8qF8WZ8JI2wMhtFpxO/GOVPHabPeV442OAnV4blgYY08oWJrx1O7vVv9iUpNwnLtm 39ro58MFczXl7Hq4yZqoKLdBUginegzA66b5l52GQIiZImzHlZ7mhK0caIGDhy42D05oAwtkJOz6b yEvNN/k1CxX3qYmNaYQbH6eXLdDYioc+oOEDTvoQA2sNXDgNwpzzzon7Jkl6WJkwYce0Eu8wgfp9G 9rgTV2c29FTUkk3a7lCMeU3cQuLkIFsYXz8wLHldy3LHH5tS6H/JXv3hwslQJw6hQGqhJkir2Qahn SD+QPT1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tcOoH-00000002KxX-0n0W; Mon, 27 Jan 2025 13:05:49 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tcOVw-00000002INr-2nJf; Mon, 27 Jan 2025 12:46:53 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so50733795e9.0; Mon, 27 Jan 2025 04:46:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982011; x=1738586811; 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=HoAOp3woacgQpHd2g/asCHp5UTA4pERK/Ity2Wb8N/Q=; b=Y5JE2HAbUYDOgT3MVQotzHC3NAfYycVUfptxIXLzJi4ls/gv/ysrC5P4nc+WSJsyGF tSGeEuGXZvVoFPAeAbfkQEC4a5+zWdlQ9OVN3GsfGSCw22xuBRAQRneWiEzJ0mS0sMIw dwenvPnlvt90nvBfTb5AYzh6KcwiDnwdtdQY573exr/31qdxkjAjUsjGZF3AvVdQgD2l GzHDwOcqGHyB4ZNuPSSsYWtz6B1kRDINgfetZFtEJgGhIlwcWdL6apyi+l6UuhyL8w5S RK21VOiKPhfkO1zygj2GyrFLgKnmc7mKozG+zYsJ2j9+FP6TEcCIopkHUL9ZBZ7kdYWc 1oqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737982011; x=1738586811; 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=HoAOp3woacgQpHd2g/asCHp5UTA4pERK/Ity2Wb8N/Q=; b=WQ4DB3TMLYmXiFbqmE93I0GrTFiu7xof2iC7G1UBHJEWCdb4U4dMSsjzIa2P16zYA/ oFUCcB/OPzHH7iNcfi8Wv+BfcMTnQnrwPDO7JVLz05JAwbU2xmDxKq7LAF0/Ns0FIHEe AEbLzkm/DKIcjF7AhveR52V8Slek6Z9UhO4NRX2gNHdP7wCme+FkPIVqgiD59avBc7YY roQ6kbZeso0xMsQ8oCy4Bky/vSFwjirDHB+IZ+m7aBPcncEkyQ2eP4DGzZL/KMhWyyLq f3vyQeTsuOSE3zyfh0fInY/+XY4mrwTALfAV/jKZqAizGfn4EfVG42lYretzc30gBYq4 XJRQ== X-Forwarded-Encrypted: i=1; AJvYcCX9SaSxQJIROUvL5itn2oIppG986Zj/yctXunRh5tRM8PNK8lr4S/OErxS+z5WGdwlLBYQhDwruK4guR1zwdgA=@lists.infradead.org, AJvYcCXRA5b26v3QYnkwJgTTZ9mjta8nGdpg+/LoKE1ps6w/Hz++V58NvF0+1aNHieNCYOwSPc01VTpgopK7n6VU9Rcf@lists.infradead.org X-Gm-Message-State: AOJu0YyPW0oImhxSast2erXn0XusUAiuGukOEOa5pROLjKMiZ56bD/e0 8yXFZaDjDlr07odCKSksnI8yS/GSVqdo3RwvfyUgtNAbTo3fdRJj X-Gm-Gg: ASbGncv+2Du0Pm4b8GrcvinjBaAjPSRnoLadqBnYCrKv4ybFhNVzcsrIf2rERtbUS3b 5b/0v5Uz7jz6DvCR8XT2FO0gwo6t0yqsJFUzW/w/FT+utgtpXTi/Wvh7+euVmBXtiqtZrPRa+N3 G7NlX3iEt5/EPcnwH/UIjmXRQUgDs62zaUeKw2Jdy+B/b5e6REpZCIxxpG5/eJ2Mt5j0f8NW0Qm DQ8/vZdG8TrVhf7I7T9uk83ObKmtjBSBa4Qfdjs6x0PMoSUNYJabZQgGzYGhkMkMpbS+iwUsBKh prF7 X-Google-Smtp-Source: AGHT+IHMBWcLxxWH/HrE9gnP2KJ4oU9wi9iDb4LPI99X2Tz841Sv8gPf5kRGSvwJqq3n4yWawHMSmQ== X-Received: by 2002:adf:ea91:0:b0:38a:88b8:99af with SMTP id ffacd0b85a97d-38bf566b88amr27909330f8f.22.1737982010830; Mon, 27 Jan 2025 04:46:50 -0800 (PST) Received: from localhost ([2001:861:3385:e20:6384:4cf:52c5:3194]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1761ffsm10811380f8f.7.2025.01.27.04.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 04:46:50 -0800 (PST) From: Raphael Gallais-Pou Date: Mon, 27 Jan 2025 13:46:09 +0100 Subject: [PATCH RFC 14/14] ahci: sata_rcar: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() MIME-Version: 1.0 Message-Id: <20250127-pm_ata-v1-14-f8f50c821a2a@gmail.com> References: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> In-Reply-To: <20250127-pm_ata-v1-0-f8f50c821a2a@gmail.com> To: Damien Le Moal , Niklas Cassel , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Matthias Brugger , AngeloGioacchino Del Regno , Hans de Goede , Patrice Chotard , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Viresh Kumar , Geert Uytterhoeven Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-renesas-soc@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1353; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=edhtWkME7JcFuoloymgagg+bCTbdLj8qaR8IOWv4eug=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBnl4AsTwch8wZKpCY6BlHXr882TR4ert8jNSnQ+ OFz7uYVB+aJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ5eALAAKCRDnIYpo1BLC tdgXD/0R8DjMyNkTEOSEqNC8cK+UW/cs7ATY/dY56SPbehRA04bCvDyn0vB/5FxpJAoPlPCPRLR j5sG07A1fk+by7VohKEpDY25Y/FkgUnLB/x9N8GY+Xgbu0iJX/ZMUYik4PAZ8Y1u3SCXHuKoaug 5N3sePlGeyyfOO1cfFahLHJCdpj4MkutMilDNOWthqBVb0G80muTn5+P7c6GIjlO4zWCmx/f0Ll Z2NreP3O6wPWEk04L+uvBX5CrWewgBzct3cBa6qQpwQaVZTsxWNCfePC/kcNWReNMSlID0lU7ah tYRc2Yr4dNCk1VZknaoKbvwHdVcoHu+cDD5hR15kXnHTlVwRb4+qmFavc2BJn5u7PyMkpI8pnMi UbPuV464EgJtVIWfitIWfc6nl5a/CzAsCAjxy4mCzQJ7V2LN0Ho6hNIvmcxmcaZN+r3ie0wY8qb o70dYTWrD1ly4Qqp6NjVaeJCqggwo65mZL2fsxEhEOBNt6bxe1K1YPab1qxwdb//noO4O6nG+Dt mpO/PmO0Z+S+3rcVdasfL9C0Wih46GMwv04m4pcRXFlAXM8JszH1FKnW7tn5ZKE9IbpCzzQSzMC zVSU7LzYibqOPwYbKCawuINy32MTTOUEdxvD431BU3xR4tALDoe0DBSGBE4QodaaX3XUrvWMqBV 362NzhZEwhVJ2Lg== 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-20250127_044652_755305_01421CAB X-CRM114-Status: GOOD ( 13.71 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=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. Signed-off-by: Raphael Gallais-Pou --- drivers/ata/sata_rcar.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c index 22820a02d7408033d698a98373e1e8e7ef47f908..4c5f5938c12efc7c8594df4092915011e83f910d 100644 --- a/drivers/ata/sata_rcar.c +++ b/drivers/ata/sata_rcar.c @@ -927,7 +927,6 @@ static void sata_rcar_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int sata_rcar_suspend(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); @@ -1005,7 +1004,6 @@ static const struct dev_pm_ops sata_rcar_pm_ops = { .poweroff = sata_rcar_suspend, .restore = sata_rcar_restore, }; -#endif static struct platform_driver sata_rcar_driver = { .probe = sata_rcar_probe, @@ -1013,9 +1011,7 @@ static struct platform_driver sata_rcar_driver = { .driver = { .name = DRV_NAME, .of_match_table = sata_rcar_match, -#ifdef CONFIG_PM_SLEEP - .pm = &sata_rcar_pm_ops, -#endif + .pm = pm_sleep_ptr(&sata_rcar_pm_ops), }, };