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: 13951313 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A36091FDA89; Mon, 27 Jan 2025 12:46:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982002; cv=none; b=Nkt9e22A7mRp3LN6scyD0sVszuTyXyBFMVaOid0H7CZHUOQ0dPd14eBdYoGtmPz00pe/en8NQHPUBaDPUXvz8vMoBmtLBx/FcVfIE7Uaphe/cuES06bJANfMMiEXBCvsKbzEu140KtJPvnnIxA8MXftgVZbbhFUpWb/35BN8t2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982002; c=relaxed/simple; bh=4mWrBHSk0HW6moMZXG5yPVWArdrATyoEJrN0gimIFl0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=EZw0g66N/0antDSDJgDo7tAJ1rKaz5rNP1jub5R2rRgwCsEYAAgaz5mH6jFfLnDrAomgOsgZCoeBoUrT3O8s+udvUPXsmZRfGWDDJmfiyf/pm8TmwWU7NruSgtssDDvCjGPzvilPZwCekKYDsOf+IFCoGsSE2gXOI3G1mVd9FKY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lNRTpR5H; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lNRTpR5H" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso29048875e9.0; 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.linux.dev; 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=lNRTpR5HRcQ5f41CPephaS5dyAWb5eUJ4yBVfrkjKtdWmPQY0P3YkFL5q/OoZhQmbc RocIo4BIFcw3THXzeML/ETBoYh4efurYvCkZv18D1IR5bovAqDTfel2JAjq/E0UlS0gV UUJ4zsQW8/kv7ndLRBRwFzMbcxN3Tj6Ehy8BhlAUmDRz9Z6E/JVLpT/CjBCfJlmcKhFr R3aJ3jUR3zm330TrxuJyMNqTDtjoAY4zQV/1j904F5Oy2wHMS4ahsHglYyPlnKGAVi4d g+AWi+TaUa3engKBV/1F3EbWG75RxWNnxdWR/w9coRydtxjONnEkakJ2BeLLUwhrHzV4 EsoQ== 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=rky8XdoUZOMtbqHb2fHbVIkzLVBxWkmUwZr6T/hQ5DLUNC6cSyi0v6Qc1SpzaJCzey HZiyP2b2tFVXN2sRkYo10jPKTLb/Ov0/CFNOQCmAvMef1Mn3F9mkE8XXAFuE25fZN6V7 r7L9olGKIusR4ogi40DG3RMpzOf8rS8NUiAIdip/g3NsKjrUP2hNbYjYAebA2d7lHvy2 stKrSD94m7MnwG1lH8VPcqgNyyIML8lCpZ+DATFTkb3Oi0+/rwjxR3IYqxBZhwPXLpd4 ecRyo7EQSNI7IBUe403Kx00OPVtIn1Er0FVAWoO7Lb63O7Rl26Gseuy0FkfiWgPpilKD lqYg== X-Forwarded-Encrypted: i=1; AJvYcCUJiUBys4Zj5ogIXz2SM+wElk+pZciYSEs+gekq72Nomqad0vuXLZbSS3hz0QAM1h7Li5k=@lists.linux.dev, AJvYcCW7gkSHzHjA1xbviTlou7sOyioxDEv3w/43jzvNngwF9qYE1NSczP1HIdnczOaBMaed0awnKA2a33Geu54=@lists.linux.dev X-Gm-Message-State: AOJu0YyWrhszd24Ro/6ioT6yjQsOvMp6BEK3BWWrOKbUXsmFfPYEid9P PP/3QdlvMd3LVQw4dpmFj3KyF8peTRhZZm0sSh590USgAU8tmoFij9rTsg== X-Gm-Gg: ASbGnctzJLFs4YHhmUI1HYjc6pwCnQ7lKtQgb6ZhZaM2wpmBAnHnva5kDZdjP0XjfDJ RSr80KCgIfAgz9fKUQU/1fEg4J929IagxImrUDkMTUOqwt9OJjqgArSY7/kFZ+s/LVbno1HHd+Z qkOg8z/E1MMRILzQ8n4dyEwaMdTDk2Kzqt6O7h9c5lP9HOSC7HeYdrnvAHQY7DRtBH+rdq+Xtir dhttwekXFSJZT+nMwa8Ffr1iTu3DPxK2nzzXs3ExHEsgzTdPD3pDfoqdHRDcg3JrpKtvjXx6Ce1 VnYv 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951314 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DDEB61FC7ED; Mon, 27 Jan 2025 12:46:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982003; cv=none; b=N73zPiHGH2d7MQnMgHwsqi1TipkEu/LePOUeBdEgwXTbBN6PV6KpXViCBA94I/NLodLz8tyjS+cb5YV4On8RmqE9iq+ROxept/P0GkG8gAC8XVdCaDF78U/j1AiPyGpV2zSEk7Ka0xleWjzveKkeaaKU+Vm9vuFX+qzTO/a8/B0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982003; c=relaxed/simple; bh=LQrJh1cj1U0MJFZHGoCZeLdGKBz6XSkjoRXJQp9xyoI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PV56FOBXw+R1PJIKceonxRzUUHzuilrCnJgv4PwQDdbfS1dC4gFLWMYukm2C6owiSYAVA3iNH3vdzGhSTtafSrCkuzrqyZIJZvAYwRg9yIvU+0Ky/+CY5isaIv5X/6YiVpwo5guDJCZjW49xMZphx5aMmh6dudiOTWYBVaDBxqY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Fq2dCxth; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Fq2dCxth" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43635796b48so27913485e9.0; 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.linux.dev; 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=Fq2dCxthP9l2+sqvCXZQRGLH6osVpgss0RgWz9hO89OsGPqFQaGY5qWUuOQXvLEIf2 bVmIbuCty5mQz9CphltyEPd1s+q5sr3c50wrA/BD8zM+EILf9u12TZU77osSNA41V7cf rgyiA0csc8pzAbHtOJy8q5oyKCgoxOI43so/EzNAMjrpAgD5I8uu0Y5qcmMtBpSvFw2e r6K1nWkSeaqmw3cqeGgnyEs5a/if5YM6oeT+U7qrLKOOU+OUO5xGEb2Nzvym7UyCbYYe dQom51WX7OMutF9zZDgfXfCpZOY2nmXzzUM6X8wsaX3mP72vCCuKy/Es+zLrkSsy8RTg zdZQ== 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=uiSCWI0LtUeYgsnAeg3kZgm5kUgSRkSJMKqyUFzm5fo5sgxh6Iii3FNvJvRHh2jf6O Qh2X4j3p42bGF2KS4MQ8QMALk5Kd/jAX4Xwi6WM/tXxMlFpFyXALvOPVDIT0ryiRxmjK bUp3flxr/MhB4grqz/jFGJlx5QnT+0qEhQIb6e5rzy3/0yltyBM+ToOf8+IxYCj154Fe uNLb0WwKK/KR4cAxb4OoE/i2KKEFWO22Z3c/axer6mOiNbhhZrHT6H5qL5K2QxU2nlxF XBIYp+WrICwkH986D4WOFoztnpP1vpmHNvqzccUkCHnggWh5JJ8zSY4cNDt/jqhIOC34 a9pg== X-Forwarded-Encrypted: i=1; AJvYcCVqCoty9arENbCfH8UzMZxBDrsiJx/eIbCyEx67YOyUltoFko3K+I6+A5aN4WE+CPJDSK1zDoj/sNpyiEE=@lists.linux.dev, AJvYcCXM+KrCv7H342wLfvSqgihjoNxEW6sWAgyHMDO96PP0wc3JabWbjSeSeAiUSfJHOGZ28No=@lists.linux.dev X-Gm-Message-State: AOJu0YwY4rYD+DIaNRcJIjOD2roCMz8TYHRgoy8ZAypaN1PkEnGat/hA Yet7j+V0q4TTZyBYpD8YRXR+vsmzq29/DyMjeuNWPuVmTpQWFUUL X-Gm-Gg: ASbGncu8pxgNljYr8lgXYxpw/+IMU+IlFwIZ0jIK/TLt3lWWcW8T7/DjAYy8JguehPI kmqR5Hm61KIYHbPY69IAmb8Ec/gMWdAZlw0Wk9//QFhURFaEfecGWi2eEuy3vn6UFHiU13Dz29V mq4XCDLRa1wzpPHrsfqAK8tX2NuLs00T+svpReBjDFH5pSYh9f5+qVbsS5PE0KMutFspPe0nzWi cp19w+J5GQpiXHvJbJzeAaKmGTJpGKyOOaLJVU22i/XZ/qVooiTMpooEbHHdjqMaXcwl2KDPVRN JEx0 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951315 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDB381FECCD; Mon, 27 Jan 2025 12:46:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982004; cv=none; b=EiATloUPcg1oWCvlVuA29bZQ6fFklD31ce4iZm24wQLXznEiIw7BEZH08ZThyrhi9pQmyh3N/rB2BOTGt4uk4Zdq7UpwB8bbwd1P4VoJ+rSGSgDBpBtpiqH8nWUNqBhEXuu97HAAjLhFwJlSjPiTgtLp2WfS9wIcuh4vnsZYVGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982004; c=relaxed/simple; bh=JYTAGA6KLOpq1lfyYvO54YfNSto58DDQ8IbvFm0AQbU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TBZhb5z2ylbcAgJV4dwzw5ERVNdSCh8t/MWAY/2vjkjJV66NVm/BUh2WyLfXeiYAaChhYv5LpvYOOeoIHQuUDF7S5n8gG3SW7te4AfGT6UyXMN+uyWnMRKvTQe6WnMUImrqlk4JSr548zUQNsS8VINlP8NQ5dtaQDUXhvGYI7Ig= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OoRfwSLx; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OoRfwSLx" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-43690d4605dso29132485e9.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=1737982001; x=1738586801; darn=lists.linux.dev; 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=OoRfwSLxuG9xYCbuq+8WdjcZtbxgvkwP0VCAHn3O0k7SXmZfkTqEoHw41qw4Mxl7IC n6JnWmP5fEpmSO/E0f2nEHpjm9lMVO8mPwuCLplQCc9y1kRgDblmk1zLBvz3lpl0dBfK u7qpd2ra7ogbBIrLCzkvF14Lui35rCCPnaCIB7msqzfMukJm1XaUZRhYA8RBg7FsTegY HSZrLn3/fe5/OJVBStmUvHaTclRQqALlzX7wWASG8cA1sfRgB5LpZYMj8AsSgtibmJBz HHTWZu59H1VdXRu5jJcQkZNSRq5Azo1HwoNqSv3c9ifYaJIgf1ACJTFgQKu+a78fT1qp Aing== 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=YMmLV07O1ci4BDLuniCFcFp5RV9nKN/w7xn3n8TkXt4E6wb6zklgzDR788awiSk8Eg LAy/9DMv36bwMLEe4hnDX7Br33CLyNiVSoRl72gSqaeHU5bPr4q8gsNyZ6YC1muZXh/O X5LPAlGPnIK+JEj2TfTsz3Tq8ZxY81wOS/3HnDQxozWYWj/MzD9NO7d4xUbon4xl7sFO 9du6JS+C5o6Ysnfl7SIEXDJR/Zy5z51OXoFiwoZdEc3DsEeAhEDlSU86I/TLwBhJqlKc HbYhQleq0DdvMDIu7hz6vshM7rOp6rbuISp+qe4vt9L5LeALpxxvDGhCrRWege7wfmLE BsKA== X-Forwarded-Encrypted: i=1; AJvYcCV6bKZ7T147sh06ygZN5Rd16G3Aqr9H1ra7QeTdfYeMW2ULbqYsR6dYODAU/B0qXTc7wOKilOnRB1yHoJs=@lists.linux.dev, AJvYcCX8PEHnduTgS43+j5f3DYfNliSMlpAWOG3HD+AK8uEtRCApyD6Bc6M2ch48avYTnGlAXCY=@lists.linux.dev X-Gm-Message-State: AOJu0Yyyu0WviUxZgClg5fREyQ0TLGOvgRO2s/iImYS4kfZlQhOYzUQt tHXzWV5qivw1AVCbu+1iv5oGKaNRojz9YZdJX4cNt/dyaeVBMdmw X-Gm-Gg: ASbGncv13ErOiOg3qQ3M5pjLKXQeojSb+4KWTOwn4Mv45VtUVVtcdcN9fc3QHYaJyzk cs+kiI3fYklCcqj3WmLUUd8tq3DV03tf9HnyObOZHkzcFNFpUXbYc7XdXzlGiciYxqE0zwBbXGf q/opf19RIoboIzc5ggZhLvniPE6J4U96wB2Y/QU12no/iUfN6sLsZ/v1AQSiehgcFml0En46yWk 81M8hzwDSz3cMtzpPC24osIi1+Qt/447Rnu+Rq1jH+tsriHs+pgDmdQxs8hZ2++yCjWDQYOFo3x DRI+ 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951316 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75E631FF7A0; Mon, 27 Jan 2025 12:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982006; cv=none; b=uVM7FCDl78NhTFdsppRQoW9i227pKS2Cba9xbE/9GpJTryjEgJ3iLQujGwzvj/W4QhCsbAdZ2lA6zaVjDJFVt8cVRzI2XgJRqCZv4TvvPI0MHmxOVnjo9gcSTGdm0vz0t6cSTCKN3CIK48mIjonhSJsaWIqheN11rMlWBl+FEsU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982006; c=relaxed/simple; bh=MLMI+xe4jCIVViG+z4qmFWASYnmXjrbqAPj9rw3IXr4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hfAS8SnazaDv9ch8RCK/Cxmea1aRMp4BkprWEliWEH8Dun7mM3JfO1xxhbbL/xtVIHkLWlku8W8fWtaDPsLs1ApCHAteQEpat3uXXu53o+md2//V0YHI7u+uJaLBufphDu2zWZaoXPGNdc+zzJD/t7XItoKJWdOUQNUZWBsyFaw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=djsDq0zd; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="djsDq0zd" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43622267b2eso45486145e9.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.linux.dev; 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=djsDq0zdIe6UyKQhd81h8fyFDk6udM4VDrfmPlEfbAwnqndOphjL8W/J3maKPOdwXU kIJItkcilSDwpvLtDSVzEgisAVrC5e80dnv8pcCJxFYOAxk9LIHW4FQlv8S37DmcHXrx /eRdsE7wSpK4lv3wXccN6wfHV9DVpdFd4C23s6kL2yyGlq2gX23Z5VVSfz/wITrbe0lf yBxH11UOezqIKEhJeDLp3iido/xtnuzIy/6tBPMb6M+CxCXE0012cArVHI5GHEjX43bH 0Z9Zp5sbf0L+5bbhMmALx88Iu2/zRTwIL4kEO20uucDH3ItlWeipIQtlBJDrWi7cMMUU iqSw== 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=o9qCEVQ7yhHscHcK+EuTLhn9nsDIRrC+P/3n119sKNhRBsABWt4FmKMNC+BkpIElzC gTYua3m3gTnrKpCNpA6/Gm73RDedcsr0wPeHaqEfYoRILxz6DJhXwOuHPBxcx433pLwc RQ5G77o9+99UBjLDb34JhBhbCy0etWCs1ZIVzAicpmqRa8d27luqeh4gIRxDynmNORbF BpEqAj//Evf/lvaG2UsnEXUHJ5ins8CFkrP7It6ggjKFiDCNJ/Q+jiFCQy+YKcfw8Akz 0eGoXP855ciQA0fWWAA+EPiAe7XlHZW0WKmsnI4SAT1YLw+sA47dHIguQq/tNIEz44vE hyTw== X-Forwarded-Encrypted: i=1; AJvYcCW3D7vgiSZqQZnYSEAzHevYGwcceG0EHVnEMPm8KfZtrn3gjXIZzcGmIvmhJm2lfoBWLCE=@lists.linux.dev, AJvYcCW9CBv0QaeLrYcUTbf6DrL0yMs4BhKG4d5Hw0dDStvkWTGmWfzii9w5Q/tIAGf9WVkOOJcjIbSS+kSwUqA=@lists.linux.dev X-Gm-Message-State: AOJu0YzIo2cPECGl22cQUY3qX2a0avAdHYJ8Z2JU6p5mp6VT9Cfcrgus FhUYuOnQn+2hQUHgIHF3+QZBDE6I7z6gZfP25ui7Kd4eM58sQSJ3 X-Gm-Gg: ASbGncvlOzk8G9AVd2FGbT/zULS9qAaijh8P3NdY5CEqhTHdzwK1SXF4uyv6Xo99yN1 j4NvaJPudK23a4QiQsUDHg4QGR+/ofepBtQyVhFACyrkOjZ1mMNChzkA9mNwHafbusUFONGrK2q EANahPhK5v3BKdDm2ByaLRlaEnVxLUaUrvvLeZthZ8ZR3UtPQgBjlJOie0+7FYt5yl33OM/XRLp kosaLRJ+xCp5tavqKMVDsYF+cEYB3n5SVeq4vdQLe/uPutmBkVPeLM9F3pkUy8VnKyZsKUcNTc9 o+yt 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951318 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E6EC1FECC1; Mon, 27 Jan 2025 12:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982007; cv=none; b=my+hQNVhm2Oaywz03mXSZxP62aIigNnTkeMcIauGy4jTyKxnz0oGPqXaQFic2+D12Kb+Ky8CXTvTtb8Mu1TUq+zzu5LQszjdr4PpCZO8rKx3zICTEmG2bjVRFF+6BUzyeMVcIw9H5cDLwgwEYMY8Z0L1HcJsYT7jvmSuTQavUb4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982007; c=relaxed/simple; bh=1NlgzpHbgQbix3Tjr1cyaZKDfkb/onDz8/2tsI8b2ZE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FAFtSXHhgq7auKZbGNnHYzE0jw0/Sf699r7CTO/zURC4OO58p+tIyiX9s+/ESg1rHUiRGnZATUGFIR2i3yOqJJoW/bbLDSNpKjWCla+OVQIB7dQL5t8+6cJz8YIDSPeH4xV4L2IMFz1bUYYrtgH7z3Ggf7BGKsAGDJ0FVYk0D6Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EbJ+J8iB; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EbJ+J8iB" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-38a34e8410bso2194383f8f.2; 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.linux.dev; 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=EbJ+J8iBnS9XYzIKvLto1oe8Sl7prbR/kgXY0BG9aH0xSTyW0OIXZbJxpX1sAkgM77 7Fr1HEjEMDSQfdFCPqF7hr8XiwH5NPXqyLalBtp2MvgH5de5yqnYMrFwRUpqw4yZ9ZpP 1C6C6rL6JDOMukm4XN+zjIzt96b86m+S15BVyU+U9YFGFxUFJrAxdc/Pr6jSR2oIuOgB wythkBMFNQO4GsqJUEFvdbxssTzH0LWyN9U3/F/wzl2u2VgqdrcW+Sq3wEDnBqbrS6Ml uZFlEZDakgNTeI1A8LJLNj6H9ARP5Vt4fz/NvtIurIVSy7OxAtTpsaRIWRaCYzqbt57Y 7kRA== 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=EBHufA7qm9bFqWXtuulVHxlhUdnONE9GaNLDFy5/dTuohwZO/rZOSEZ+0KBihTBN2R jVOhTRDlbUtCLOdsw99SfOCa4aHNwtprtt71cK9msEySktNvI+V87xd37dM7XVWMB1Vo MzzIuxJQkEmDSP5IB+dlHNAg6v3ErrXAVzQmOcgpBsatg5h0uSgcsAObJ/o0rynhAaME cr5jBPIjh9H7FyLll4aVn3zv3AHatC5oKFyQ13mZ9cT1Df2YLb3DqxrFkz8rH5vj+Pnw KbXcKEr/qESTNjeaEgEK74bKdKWAGAHWthK/8KH/0r/DmfXYZC15U8Y2Njn2wWjyd6m+ FrcA== X-Forwarded-Encrypted: i=1; AJvYcCVKslIqU5VAq3j2qj7cI9kF5En1UC4ThdW+vHU2etXRFxhWW9Wu6TDkknxiUYbwzC1ihIY=@lists.linux.dev, AJvYcCXQErAt4kxrDyz4Mzs7wiuH3JUdWmDKRCFZ+JwsVXonNWkIPatI/A+uM5Iq7HxVmI4bi9cS4w8JOHEdw+k=@lists.linux.dev X-Gm-Message-State: AOJu0YyIhXPmIzucoI/69bOeYaf6MNYQ86ZzdVDK2Y5zfJ0Um1HYiDa4 6Jdefzxuuoi/Q02vTeYOKci6Dk8N1oR+K1jci+8I3BLcaxaJj9cJ X-Gm-Gg: ASbGncuVdcjasZxp5DOcnemdSf0yf5uTzB9NxJMFl0XG4eNXTDzlo5JgpqkTbJ3/nn7 tFoHUDPA9wsgKQJMslrLTxLLNJ1dUhJ7ShXIDCgPobOmkaNULC8HvqhkvFuT+WiBeKVZ0msklyx mKSjKpdt5gyiYSKUKyKFg6nZZnFoA7IPHkSciEqS2XkYFjgd+pfGdq8MaBcWKcLANa1CtZL1N7S 7ZEWz0D+XI79eu8mDGDbq2cGZvLDIf3iLxEqO5BEy5/ubonRPUuQ1DhVR7ljmpi1ZZDZrk1xOEG QiE+ 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951317 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8AB81FF7B9; Mon, 27 Jan 2025 12:46:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982006; cv=none; b=Dfye737stVBKqytUEjkBc3Wbo3L7gMV845UhoqvADJRB07xi+UArVN8fLbst3iwzKlyiU+ceE4L/hm1DAcJIUn8Oe/7QFJAl9csYckMkkSUXShlFaM0OymEn7E2O5O3wHA25GE/NfD+hP99W10zCK9v4S1DxR4/u4n2rmIKvlAE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982006; c=relaxed/simple; bh=uk7o4XEuCDy+1MRV3EDgkqSFL3eYMvAL/KrkBwR1yb8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AJjf3wUy2uqErGVWDyvvGOXpSY0N4jMwCiZ9tZvyloVXUdhhr3JoilgHeQPZPXMvC82Tu6awk5E/xis8HLHUMCCAc2sDcj6X/Pkf6MY7Os12+O5HgY1EYqIb8inf+VWe9vMc8IJ4KxwGHPt2wx1ADOCqno8psIe0SClln9/MF5U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BUDCMQhp; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BUDCMQhp" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-43618283d48so30768185e9.1; 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.linux.dev; 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=BUDCMQhpqjhJhgtQ5DqmzoVV0K1mrEdin7pqIzoE5aNkU+7V+F/sacdJqxCE/u0CI6 9RvbKL5+wp+tVuW+BHyzsFTBxCAOKCcF5dJyP+0nziCdpGn9ap4mtu8eymi7R7OFQ1wv t7H1fWnW91VejNdyP94S2vsjMdyJsYRpZoY+Tygu06lBSXx3JDD6Wq2y+fBzHEGYpwew 86/5IYb0ndhOUreq6tEXAN35ZwJlGR6U42e/QPO5aMtbZBTiTr5bLXIyQKChQM7zBf4F x0BQc1+H+fCkk9zsakjr2KcRC7/HwOTjsHfs4CvVdUk0orUO6jYD1EVr4T6ofc9YVwlv YW9A== 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=HoJVfxGlmymAQTY7mI3K3DYw6MZ+I9nqAdqMrFPUHoTYhwLOk3AVMFI7FjDeq7WtJI GOoku37U1GB4JpJL4WXh2QcDfWSbkTASzRxBsEYzx8ucgU827yL8Wb/7UsHtHChTQBW8 GZJnCmuqz0y9LtALyUZwOOPAONKnpanFkdE4RzhuBf3A7RztXLS4B5/cY0SJ9kBRw0yA XaxzlOs3qbTDp1VHUx+WObFb3687xqSFxkty6okak2dW2dWliZRILUVrohD9+FTDHPjI XRHw3ysw5CuLOnWIRdh9mzm4UU5avogeErJFEaJgsO5VNRfT7ENJl7aCV/Gjk8aZfeSZ IBHA== X-Forwarded-Encrypted: i=1; AJvYcCUlMOkRnF4rEW9r/8P8qt17TiLcro2BsFJmfSt0ZrqiezVtsC8bT8Ck2hvnd/MVRprqr/8=@lists.linux.dev, AJvYcCX4VlVe9xqeNuws9Jq3gKFkZBfb7z3QT9KOMV8YopUufUf7IsmNZKWaiRFQdg9Bel3a6kNoo9usPDO4VI0=@lists.linux.dev X-Gm-Message-State: AOJu0YzEC2JEt09wKL6SUrWn70bn99wkUKESb2GKfVk1CrrbWd+9t5qS G+I3V+iELY9rn45+Q8LAt4f1KHoIynGDvJpyS8XhkWNCPc5+JKDA X-Gm-Gg: ASbGncs1PP+2IRHuuIi+tsZQZt6BblTUkiS+WW0aqtA6Ygam52sjxOSXk6ixjG4Zl1q 6SUpSakobjajeAv8fnHaeRVoXkznrEvGWFo+YlALCQv9SMuVC1jrOEzzQUpFyNXCdnzxOIwdbzq KOWMCvX7ig8fFzGKrnPSqQoMn5a0ZPLJUZmtTD3buPyYtUn7I5hcw6MidIfdCLLD/dWPh7kUcBr Helkzzgjd9nECNks1aIXKD0U0fms7KGk/QipWXjPvWFisRPSD8oFeueba2rWfiGYIgTHeCX0pHD 6qJ7 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951319 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08D141FFC45; Mon, 27 Jan 2025 12:46:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982007; cv=none; b=K4et7i0Dh7JPFhDNTDZ7Vz2qT7ME0EcJgP0ZqcfSThc9R/5n2fRss50eoLZAUd4X+7l98BdclnIKBu2VGN2IhkPkNQlb7xJAJJ2GxYo2XbRTnTszQtwx91azFaG8+HeB/xTcg1NCOf45jNkU/4f268sNy6CBRNuQvjtOjT6X1+c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982007; c=relaxed/simple; bh=jtsYpUlRDrqFp7RoesBiE8F7bGnmxPqG1z9eHllOyN0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dNdSh7gB098cGdZeaVMnR2z9CtVQ47jC77+hIsLvXdOs1yqQj4Bygy7kTE3ysj7WWtYrcvJ0/lRJNIY0W6u/gtzIM66lV/p1uUGLeDS+AAtHZSsC1qtIg8PMtf7CWLBTQfHbNkrVLasQnD9n2tJKhMtFdHaltWc9IRzlOct1OXA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KKmLTgmQ; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KKmLTgmQ" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-385e1fcb0e1so2174944f8f.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.linux.dev; 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=KKmLTgmQk1I5i4gfoCcP0Jh1sdfD2LP7gbpcgUVcWeaQc1S2d4oiIotcCGppLOTdtH SUIOswcqTAAMdhhqCy3rpRja+NzJ5LswVWEGk4GYsoDuoKxzM1shM0nfSQyfz+4LM9DS ab7VaX5QPfa1iv7ZqPlgT6EE24gKhNGsBHPf6C7kvv2EZpkJdgA5zIydDfJ8kY8lLnnG O4MzeyqCR0Y2vnae5BcLeLaP9nvymxN1trl6yT/ot0rd+0ZmbM1Y4kz2sC5M0fUVhV1K 04rBY1rCg3/FlLxU0pV+YEfZxSWQnN/Wi7Lv+sJemcQGxKL50wTFegnuRF0LjpgayR+D THSQ== 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=PHFk/nG4dG7OyENzVyMmGeOZ/+1waId9nAfuW7pwmVn9cHDv1GAE8PMm52JSv3ubUA TlJ7n2ITx3mBNzbe3bBn/8xuYqLGc0Hn+Ezr4OIHEhDxOuL7No0+U8CCyyWQxKJ04geD gM6p6KmYoGutzhP97clbCwroAx4B04iOsFjaukJs0wVORfHG0IASBAKkM9D2hdkUXBUz Rlzl3TYcBedL5LM28UTLF1HMdCr6BJG7BS+aIhbPjk3ey8HoKW49mYbh8JGranmW7ifq CgGDLGF8StdBlEZNao7TJ7iz0h3lvgajuURGw+HWvpi5SjmjRdj4vArrpnoPad11uAkp sE6Q== X-Forwarded-Encrypted: i=1; AJvYcCVxICQ/FXRjsfdJAaiLeulBZ4TvJmAXG3VSBStRFG0DAsiNrfmPm8+PGJMD4l2R+t5lO3r2W8148mpNvbk=@lists.linux.dev, AJvYcCXwKzHQUX6P7Fg39ln+ZV9PZpCmfGPqiKiwa9+6PeWSNCZSpiigBHtE1OUhFUGISw6O918=@lists.linux.dev X-Gm-Message-State: AOJu0Yx2NNlwFi2utkJWRXt/0gx+OtfxNZVc5yoDnWhoB3ZXc5mVomUZ jSOPfAUccyP2IZOcQXcsj0s7o1HLWBHHjTsMECYkCWNJyGS4K5Bc X-Gm-Gg: ASbGnctRiFJssYryflzcEBguuPgK/4fj4yah+6gmtBpl2zVpxmwF0UFIAtLBC+ORsOp FurgRs5meiLeK1PSkt8N+FEHPdaIL5oNrp/7P5IhBbFgk5kOs8obJ9YAdTuaDVVtPN/1EeYD7C9 UomWfWZeBdAzZphBrDy8hkaw0jyHJbVa2I7Otvl3L1thL9M+XYjtYFizH2y6EqUiNL/X/+FUnIk fbFL5cSHzJY9oFou3Jl1rNoMyXb9Lfww7WTbpoYzui6NdPvz3rxDIVbeXqu+fpF1OmlDf6Xc9P7 hcl/ 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951320 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB4D41FF7B9; Mon, 27 Jan 2025 12:46:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982008; cv=none; b=R/CgDoTSBhgLpPPC1W9mMda+trvcIP882TmgrFPCNv/C+znPEtlyyTKvFo2dAPnoUubwDPxTAsxEgvu9QV/gIx66cBcPGYgSBm+RiJzIklCW3mZBSE0Ab9zV/f3htK18QGSQQl2FjyKbwHg90i/DNPzZXW7IE5QfgeP5q4ghYh8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982008; c=relaxed/simple; bh=BVe5T/T+KyUbuPkxpZh30Ji3hdJ098Bkd+OSL6K5mXQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=khCSqKpqP0kV1j31lCNea1r12/iEUhWHTMzsdCpeYNAKxbwPNlD3RIm55i9CuiaRzQXIQ68ihtcTuoPjikjFqM6vlegy47J1O7GyvtjGEp3sK3QBH+pPRNXvX6wCYL/ME28Z0SmldjEFlt/5hXqx2Xke4Mpg4FHc9gr+jGeg5ws= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AaAch6L5; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AaAch6L5" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-43624b2d453so47725465e9.2; 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.linux.dev; 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=AaAch6L58Ch19zhpebRU6JWlQBxddzvs6UKxbI6xdJ/jorXdjlq9qhqhVQyBTYJuBP iuiFFSDQFt7cdgIg96fVhQSsDct84YKJ4Nox31BeCfYlOveAQ4jbgylj0O98OWFYsDCh ci+nLqcSfLAz2L5Ft/rKWTyJhuYQ9Z+8PrE67Qbwxvf8N1q2h9A3vwyTx71UcPj1YiF1 qCsIaYRyHIKkGjP0QiY2HGKqekz05weeY0yDg3TAtuD+STlHu43NIYmx5TNwdetqSAiv zMFaaUl8sO2eHsLEc31kNaHO5koO/m2wMd0YnYnvu7V5gd8i2iUEioAoPsnHBGzZ4s82 dtnw== 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=ZVxZUE8buDJWxEntOsQae43+QOni1rrLsP38nCNkV38mtQ2A4R/UVsCKkEUiPgQU7q pcUMuJrRMGXDqN3eh6AMVyRD5zybO0LSbIin1nOKnZGLuuLr1SQc63gx7xxcQl6mP3u8 o7ssyyuzw5yG7M/bU+VdDJVKxVqZ0u2AsDN4DeVKQ5A5kiHi5oP3BwtwFcjGSnttF048 /pLNfYAC9A9j+74oUgTiDYZrDKgJBbhK9I8x7t7qHgr0Z29xrFqeAF1vk5T9P4gD35HW KuKx5GgcQ5OXMYscUS6ug++zG/9SY9zp7/XbpXqK9fCo7L/8OGseRFmvTdpd622063sd WGCw== X-Forwarded-Encrypted: i=1; AJvYcCU4Rkr3dRmpy11RLx6Cb4sKShLX6i4q/ZenAC95Ig2Bior3p52i1dw+8F/WBbqYjrb7D5mVNtkFro3Fs4U=@lists.linux.dev, AJvYcCW4aDkqA7MZTTFCJi+9STGpuP+1jpxrRQb6Lt7hly1XkXn2E3Cqn8csRt66xXDFCpX4dNw=@lists.linux.dev X-Gm-Message-State: AOJu0YyYF/Z9t+lFE3UbO1Tvh/RWXDrpc6ATLhU8YYDNGVDaHBqo06mI 7vWxWMkSi9qvxJk9apIBaSRW20fGB3LaBb6abht63IMAJ4g6bTEb X-Gm-Gg: ASbGnctqwP46Nyl6MKEI92ouUugsBixHpPGU6ut7fr9UQv1KW4yNsHfy6foG/nais6X bikhbpka1fUP1wwK9O+B4KxU2pitvmpBJIpjV5Fxi4kBgFwCPcLD0pGW6q44JXBUguwbnyxHqti QYhMOTmmvbov3nBUMCgYsFjj9yyZe39O5WOCgAVyYSFOYeEg2cLlQ3Ge/PqHIn9hmbsNFns/XxE 1TeP6GGS+72K/obwtM3L6b0m93pnDzlbjv31TFcgIwbOU8tlI6LEy5g5IENrjREXMq4S+PVzCM5 30wU 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951321 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC30B1FFC7C; Mon, 27 Jan 2025 12:46:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982009; cv=none; b=EAZpyLayXalvZgPKKyPKYRy+GUGNttvPuf0VeN/xrbfnfLE/RROxvzf1P/Oqp2D10zHPJ2ZGXYjAgn36cqv4s/xQFeHN+lYEY3h/6pgCx3uv239bNQkKMUC8vIKIfsh9Zo98c5f9POdeirD/ITvKh5vdzLy5Nzx0I6ArUVNuBKY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982009; c=relaxed/simple; bh=4ewGqTecw9fB2ZWQrXC3ww6+O0Pce0mhF6dQFMkMaFA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DZCiHDWIgP4wBHNFoZNaTnrCxPUiRK52runEmS8etg9n1Ssqgnh6oGerXf+WwC/Fw4Cxk1im6zumsNgwT3e2O1gJqbA77on2naHU3I/9TpGIiWzm723Kmd8frvLdkthpA1DCBIyV1WFOODwztxGbyXE8UT4QNQ9/TFNUJHlSjlo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BWWgr98o; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BWWgr98o" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43622267b2eso45486885e9.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.linux.dev; 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=BWWgr98onuWJjL/NQl24xGkh0BPW1r9ScmBT+TUdkBYXhna2xdYEwsfcpB1NaOqxYh BJ09Cqqt6w03i15CB/dCuCbb/G6utEVvKp4rTl8rsGBX2C47zzEmcuC30fTpEkpjIVZX noiHdy3qx/uku3jL/U9jSf+1sc1yt2LqZlQIc/1HbF2CII1xbTvz0O4qyFz5eo5/2vdW hVdSh8xSKxW2p3WKq021NxcKozJS+sIM7/B39c2rKbiRpJDNQEv8D07FA/YvEhQfo2C2 y+ioqlih8t91xAUv/tjVojtXR967CXyZ0sm1yGHRF1qeUe0WNaaHXdEp1JYvxPoMw7fL yXbQ== 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=JlPG6AIi+THEcBzAyiibj/zf1c3XowNoR+9jGuzh7Pj8TPW402RVUDOhQJmq0LZNr6 q9Dn5klOScpSwdKpqes5v1omlzR8K3x0cHa3Aavf1kHe8as1/ZzptoL146jLxVnGT4dE U9dVLjY5T1SmaWzHZo9ZnRmrR7Jnhhn5kPRymFXZnyf8Taxwg+Xaj0g6z40oOoJcuOaB zDoHYn8HuBk3SEJpJjZ88vMr4pkcpIBbIvgTwwMRrsvj6V3lA2ZW2NO3nxIVkDVhmbLB Wqg9EBBhsK9HUgAWmUrjD4EAHmNDM6nEO1qxE+C5wzXZWl8jhglPMGBHXuna/tnxpgFs NsTA== X-Forwarded-Encrypted: i=1; AJvYcCUBgKfATMBYK0srGQOpiLCxS8uKfsIjJo4KKz6R9Zxv9N0L0a8mW0yGn/3PTnMRSFvXBxA7C6xof1THkN4=@lists.linux.dev, AJvYcCUVt2jSyFGKV8cWsEBHHZDJoNFLPbu/O7WCLSNcX206BYxWGSB/SeblqzbMbbj9h7VcOis=@lists.linux.dev X-Gm-Message-State: AOJu0Yylrs8kJ7HRo/zFepUGuhnRnQFGPTa7BDfb+tPeSjitwCY1sND0 0rUeeP5FtoOZW4uNMXDC5N6o9IOwM1YpfQBDDPfS0/Beul2TICfq X-Gm-Gg: ASbGncvb+1cv4a0Cx9GS8UHi1NLxRVwbNrzdvqI0cU+Pr4NBuX5jiouIc18PNXLS2ym bfIndmclxgTyGYnH6KpAR86vPOi1ZD89huSsGAUpxHZYNUAv5XAJdLehANhI47F0R1He9xO8f4E F3a8zmslUGkMtG5O+QvmJ/iis1I4afETjkI6Zo1rUOHFIdHKUvPTcN96QT2XSUTfMZNh7P/YRye zFBStB8yf0UfhPZdgSYtJoFiL/iZ260Jp1swolr3Ig5haOLgjY401zy78jK0CfdnOJ04wb0Ad6V ncoC 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951322 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CC9A1FF1D9; Mon, 27 Jan 2025 12:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982010; cv=none; b=cUKWJXWAR6j7f4odUiTjXgoRTsmR6O44JmcvtEU/0mlWeCyCNI86su4UyflEnOXzrBiOombT27Uzf6bxL4i4knfDg9sdSkemhWaZyDSApoXhOdXJcbNA1764gnf+Zd+iE/az99ZqVn0pQSsGkaEtCWe+cW5DpsKgeB3YJnb6Kro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982010; c=relaxed/simple; bh=3GK2SPKfq0gy3cNILmQ5ZsytwY/PBIweFrsBnfiLWdw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dQXNSa9CGDplKS5NBL22e5zbrbZRuFzekY2DGZ4hPS2Cr17EhdqDQLfJwg1KUx11pcsT9JJC6YFiKymnFZ4h23KmxxoKf6T0utP2gsoIKepzszBDeJjCtyIUW2I9y7v/rz2yr+5aRWi0Iyhs0nRYK76Ih4MSUcMxzAm/QPnH2lQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AenV9bOp; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AenV9bOp" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso28431405e9.0; Mon, 27 Jan 2025 04:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982007; x=1738586807; darn=lists.linux.dev; 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=AenV9bOpU+Q80jM8uHQCXlGdI0fV6h925Te/q2WW4l9MfGt37lMws9dZ2Y3KnrEZT2 6KLZdv8VE0xYme/Nb9XOOwHF8MoOkmv/ZPQq3870qyjiKr2oh/O8rArlt6XDk9Jt0xMr KrD6MItH8r7gLAS0viOPrY65O1qRR4PMrtRF4RFijh85YKdH0WIJTQnUvkx6s1A57Piq oG/ukTdCE7WRf1PzO4L02gyoUZm8/RQxPiuro6bYv4jKq3z+qab29co+QJrVah9zKIGW /VLGntlJPP4uWo9RqAnkQDdEbszd309L1aje+nFH+91bByEiWajdalq7HMiQ0oceU4p5 pkVg== 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=O4KXHLI6bn3/OIM8ephcAxIA+KfdJOK8OKTfxlSrD1RE3foUpBt9Mml/em6/1CviRk biowO4n123LUKGCrSrjIGhfy01nn7SzKxsCoqk+4BE6m22KbzjKPQaoZKOD6xBJxEHjJ XsdN1JDIRL3OJpiySaILNqXjdN31g0MyJFpj7MwfX+7Vj3Z5l22NJEe5qF1pP4VD3WlR f+Uo03RFzNHPJVNV1FRORkHNieL1jkdgAfgc8rkFa9WgyHthq1LCtXM4ul6DljOK9Oo3 cto3cIWJSbzSUEKSPtDAIT/6FAZUOgdmCYE/Zxtz2OlzWyB32LYbeLJp4vMKV8fr4SLr uitw== X-Forwarded-Encrypted: i=1; AJvYcCW3HfJ/gKWp22njo0oBYcLkeENDDMCmKMT9R5OJcOSPKZRfSSU6wxlXxV7vg8ADA4Eed1EZ/jB9tVSznAU=@lists.linux.dev, AJvYcCWMG0cZayyPkNw0SJ5I9QO6oHHaCN0x06Uk3vR26SPfkHt2wzCoxrREiEvHgDYRY3ttP5c=@lists.linux.dev X-Gm-Message-State: AOJu0YydqkvQTenPKw+juUB1gw3JVbYSViWjjkjFL6HUNQsZRfQusLWo De9iO/XrxcqiuSUTOYxtk0PrIEGQJBsLa1/LOuxA0O5TDssIJtE1 X-Gm-Gg: ASbGncubvWqQ5/D4zmVkLyr5VciyTd4jZ84AHFSJTxBQtTg8dwZXyBZ2O8MzUIowpxs 8F1QLjeOdgUxhs2Wv1EGvRCChcTrBw5iyooe3lIw1FC3/fnIon35SHpdil7mU5lUAWWWFBT6mH6 0l+Me932Lrf+/Cywkjkccy3ksCmLvyq+ANI8qdzt0p4gCupqZDPt0Z9w0VY5MZeW5rMY2mGVlhS 22373SlyyfBmgA3JTvoXVsGS916yyeUutTWw9flo/Mow6AJwJNvAcGzLgzJLlgEiK55Xh6xQVz7 KDtT 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951323 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6288C200BA9; Mon, 27 Jan 2025 12:46:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982011; cv=none; b=fZZTAhp1PWY0MVZazuavDr42sniBj5LCHZK+djJ/ZD0rh9bObnfc+cmRPLurSzEmv7C3OSnd5nvmdL8KWRf6XpYTRUDfoZBtJ1ZBgbYs06D1gMGYSylv6qF44Ax0QrLsomXiu21MwHY0A1IxYbg07Xstds6TCVLWTdO4lEQ3avk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982011; c=relaxed/simple; bh=W9yVEdw4qSI4n7OCj5u/OGHoNGxhi+e4Ou6sa0uyD7U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Xz6OiCV2FqYmzqYsUW4FHluKZj5G/nZL73HvikWTx31qrd3y58qV4Zd7EHHG4TIbdZXbfb1OYfJ0hLyzBsaOSVbA4FKOCUM5iWs8c5zqJb+V3uVUEIsXVKt/HjjAMiY8V58JdA3NlVqYMSze9rfBZrztwazowLoTrPDICBtUxTw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BVqYJG3Y; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BVqYJG3Y" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-436281c8a38so30596265e9.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.linux.dev; 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=BVqYJG3YTFbkwsD9S94FBgND/fBOPuE9o69Q6sxTheKJyBd8cpVUu4Laia6I3R4DEw vUnUPdqszy1cLu2bb9wHiMNPqco6ZDBadN5jZFbSnjKYPEN7y7Z/A5wtOc/Q0oq+sGy0 GPERK40266v992tGZmudVhM3AppVhNHiEOpi9ppF7I5nM3RuTVzADpWqbjSLPSQ1SeBl /q5ln9tpPV3ZFG5groIMpIvd522/4wNe5nQCXWd3eFH3cG1Po5wRkda38wvrKmnAnrQ1 WdAuD+pD5W0tXyV7XJcn+ksOF9jOEohsMiKh283wLP88SBSnGwvoHyjkWLTtRQXqk8+T tNUw== 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=sPhmzEx6jDwMU/H0Xr9mHJ+dG0aKBUnAA+rGcS1bv6EcETwoH8g5fLK/XIwr00zIVY OH9ayQ8kIM/4uCLPhoDnsh0PEmeZteIAg+sKv/pkjJ0k9mNtT0Ma4o1pGQPgmG4zxY0m gZEUjlUarEG+EXGuASZtlQHR0V59TL/YLB8agOrsGbCJi3+DbR2gEXuuWY3NjcyiO5Ih +Wo7Q2wiRZd5wRL7GbRZMqr2sCThR6UFTuaZW8JMxe5wscKyATsrA9HPUGHHNjnwiH17 S8S4YVGCZeY+WWEdBORnwGCOsk5xpsLBPWSbXKmZGDqIlVoKlXyH1s7Bw4zKaFUhKvSo FNpw== X-Forwarded-Encrypted: i=1; AJvYcCVM3V6uLxKO7+oRsEarWOCVApjK1Za0tKeNmwLlvIYlgv+InuV+GzyqG8SD9JmlOVUdrnM=@lists.linux.dev, AJvYcCVueGH9KmEmCUlt3FjbshwIz7pEKfEAwBG2IlT2KZo/sj3S1wTS2nNPRsT0d/mMHh/aTezW/++fXLIBn5k=@lists.linux.dev X-Gm-Message-State: AOJu0YyyWSr5dJe23b+Uq93B/4s6srifIsoTAcY00PcDz/Zseev3sQzI ADmQMcdj/2E9z6oj/sZE11sOIOtacViQ7n9XQe1r5lAvp85J/WjT X-Gm-Gg: ASbGnctrmJ4UmsXHiYY2u8i7UiOtzDZ3B1NdI6sbP5v9shxxLf6FM4Vzibyp45SKhDs ygyW//FdKXgM10gG5lbeN5VpB52qWB1iR1SxfiEqBkiBCTu6n7sknzKOL+d5YXwCFOzgyrd5Gbo JYT8ePEPw4/9cCK+43Z8ox7+z3pLZaZ5mPT6d8pNErUgD/Se27J/s2nY1IL6WO/9Nw3+igJ3z9T yToK/Mkivn4qT++yEnSwFAVZJ35aF7yMR08bb+uxY3NXvVCi8oGcjcxM7VAsWggu/tasvLkgZCk H2Zv 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951324 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51FC5201025; Mon, 27 Jan 2025 12:46:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982012; cv=none; b=CU9lvRNH5VsH9scTopWFx47LNX18kKpuQ0XQm1IT9finNyk/IY6gf+A9lH4bM56G1jbVp662mAy+nnOWFd4uBLoqtQpXmVAycfDWX/7oCgeXJR2nDOvYlGBOxDJ+1xTelvhOc0e7zZcDa6sHeXyBd50kexmG9bgZyEpiDd6zlbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982012; c=relaxed/simple; bh=RduU4fzm2S8yXhoNskJ0+TWDY47QJ0ZCJVc8mKi6Q6E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s6NnS8dCO21qWcwuGsgaIRBNLWfkIPY+N9sU+gJidF6Lmbf4hrMG3Em59wYjkCQ4toO6JKAmCVePzahJ6AnVWxUzCmylX3CnFV7p8oK4iqsyBfQLW7SzTag/RTCPlCJjT2BUNsMC9jG3r672M4/lxeL03g6cPM1MtWfWPun0H14= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UJCX+m2c; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UJCX+m2c" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-385e0e224cbso2490247f8f.2; Mon, 27 Jan 2025 04:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982008; x=1738586808; darn=lists.linux.dev; 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=UJCX+m2caz8M4WqJ5ucmji0eXEcGT4CFjv55nJ24oZGIt56Cou/ddzplyqvF/08l6E LX0ORgqHwPzTMNovm+PZW9C1QhU1rz9JkU33FN26GzARcth8xaUOExxQoeWHhKM5IH73 MGp4fIJNVZg67xV2R9jf4B7reqGwH/Ws2aP++B+d7dm5rIXc+hZVTs1KqvGEaRA0oQZn yTt49ndqnJqYgNbfjO0aTqB8Jd1QSU+seMkTTP2swc0I81AD1UGQWk2G1ml0cthdjCFb h65X4ils9Ht1UgfaOEWaXDdbKyZq10xxCLViZ0Lp9SPRjgHP4DRBW4sChINJQ+DIEsKh pQ5A== 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=Qh8L2ycdIOJ9s27GkgvL1U6UGDaaQ/kn+iE/PILw8TBL7Pqfy0BT5jILFCU57dpgpx 3ATzwXtLE12suHin4ivHje3SuzEb33z4UijASfzXN+b37k5LeezwqxMD5OpljbgNep7G I0lU8evrKlAvW1uW1TC7L2G0h4tOfSQn9CeAI31PT8JUB1CpwoO7QShcKC/ogoa0lEth pcKQvfkmLsat7Kuyd+zPSuvA+aG1FVEHQUVUtkqqp2hXEvcNk6uSbLFAdMY7jJnti6QW 6cGsRRDfStvj6k/f7lKRR5HtOfRueP/PhLohKvrD8sqfTgmDLUgztwgJXhsDwJY7lJTf arTQ== X-Forwarded-Encrypted: i=1; AJvYcCWAQ4wm/H+2KcBDNXeZdhYfh5eIwV8+MdZMlbs6+IR8DaXwCNjUoQQJlQumHv438h+vcwI=@lists.linux.dev, AJvYcCXXB2zqkicMeQqFJJK4kwzDcTobn4g6a+1sLTAnf3PPa4z1FcZ4truWvUpZ/TguoNgFensfiQE4UhrlJak=@lists.linux.dev X-Gm-Message-State: AOJu0YzVu7oeP9dcnPo7ZGfv/zlwT9aTGMYbJSDDoFVX82T0EBtH8lqe E0ddqy3q3fTfabEC+4eZZ/Izhcn3txs23NFlYnlars8cgnSFfaZs X-Gm-Gg: ASbGncvQ8oXFP1vDdqkG3eyQv0PtsLg6g4jkmKSVWPSuJSG5JcZXSyp1UzQBkaFQA53 3BV/fg8lrUV88rRU/XP7edxirWTfxJPqmOLEA8nkGUAAaNWlCHWfH15ytaUXokCb0CavzI4erLg xstp1B9UZPdExjJaZuP/CXGaL2033IgqVGMTGSBbDXlkxCqb67tyxwwlfI1GQ9G/g3S+jzWv6ga gkZ/0lTE31obfvMlf4+R7kf4enJLi/wolMNMWjNpndWORtl5vrorA8kWRVXqiTRl21KuX4xSONp FxOo 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951325 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C1BE1201261; Mon, 27 Jan 2025 12:46:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982013; cv=none; b=ZHJya1Jd0WS7WGKdgVLFAdINQrx4goa+0gnL5+zvfOdCYqKU+Tn7XbxBsyR3kckOhcMrJ9tzGqPYToi8JHp/DG3ft/w7la0Sd/7lcG8o6r0PkRFH89dXzdsG0Qzt4XE+2uXvMTyS05mnA1dZS6FBxc8MXftxUOGn78jjvGcuuD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982013; c=relaxed/simple; bh=1sjh2+ve+pLpl+qs4JFyeDCujvbM9xUUKhOAy+ucg7E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=jcGP9F+7Cm7HGH6iIT7yiSiFpuqjmSsZj8W2WFJMSk4XjnUzWekULd/8StcLnEYXUSNFFkuwttKJhCF8iGeBi7HIzjCf18VgUqbQhrb9zz8xvDDbi4mUw1HhbJEMiIRtXaW6Jp9i3ik6rEXz2IKMRDRcSSGOdSaX5I7ldSWhibM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TYW6w0cj; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TYW6w0cj" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-43635796b48so27914525e9.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.linux.dev; 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=TYW6w0cjt5iGX4JWGOzu+xosb4lhS4xsPs/uAiMhU49HBoFjjktHKkF7X8ZZ+VSgXf VHMmcrzmGKm90vxUKNdAk4x9ERXa8LTKRs0qXig2biq7r3iTfWYVUXtBGjVBFpRqlOcX sMaNDD7tpYQoSrPTLR06aMbJtiCGR3KpHXvHge0KSzW6oW9GkA8uyCse7MMfefSIQxvy 0iH+nh3Sukoko7yqnkL9ZBQXjKCHhjr0yVF9u3Uth/9wmpRbKr8q8aP1SSbHbiixEbZM hQTQY2cl/GGi/GPA/J6uNwQlGZ6PnlF/tqV3+pwZHn+mICSOU5uv4c6Uhs5HRqufoogJ zIFQ== 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=ez166ekbwU8eKcZzqJPgh0We22ZhdGOBpYaw83Xv5b8e7uHYRGDGYT/Asfag8GGfG4 5akYPVaiF/QH1Hh5WFZFoCvzokstcMqxRnO7RxTC6g2kvjWmfDxjr6mP4EbCy4Sprsqe jBC1c0ZdT1NbprxS1XrKfU6rf0bpFv2rmopAr1KFgAMd51jsm6f1AexGSv9c9eextYdN vVKq77oWP/fQkzp8QfOMJV8ZYgrfQQJa/8vi5+CB/RHc4iVklXEw7tgEqZDr1s6ac3a9 CLz4fqKLnIiP3SAOzdIMkmWLVjlP1ikOSqXcx82GqucGVNH15eT6U9ahWmJc4kpOn5Ww gsgg== X-Forwarded-Encrypted: i=1; AJvYcCUlqEPxO6mzgWbo99Dzgz5B9cfPBJvDcsNdkVP65KLXmcAle+pPwNl+hLyrJTzwI2EWcaU=@lists.linux.dev, AJvYcCWj0/RWogmqH7ojHWPsj1rUgcjLvaX3FOLT5DhJeHvJ+qbooO+HA9iDQy0C5lXC4FdXy8iVstRnlZNul4U=@lists.linux.dev X-Gm-Message-State: AOJu0YweOPWJbEQRVASjH5oAuhZZaXwZUnY2RhRpttqmCvdqfesPsbV1 SaUpaPt6vRilBdsQjmGeFi8PkYpGsCmEGaE2G/M2ZIfKpWmNDPCA X-Gm-Gg: ASbGncufEC8KFrOdFvJ1h9/x7i5wrCOOlRa5pfIWNCeyQeazDAT9e/YI7BxVWvjZqLi Pq9uOnIEiOtv8ZOr5M+kf06fzpYGBlxMIxAOYbQgxl9jEYbM8G5Ujs2iXYZmTKSsXgFsadYxIDm 9Y2OmQvFYb4AHxGy7ahccn3ikfBj4QHHORCkoPorJG10qDKYuOX+vVzk5OqO9rzPm49eJHTTr/l DSH0sCrODdvDbW7MCwJkSsmREDuC1XSKmZz4DH4o+dcJK4v3o7IgVC3Pvnzj+aPGMsveiGQhjZC oDjy 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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: 13951326 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C588202C3D; Mon, 27 Jan 2025 12:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982014; cv=none; b=ZB1hHMSnFnl6RT4Kwa0qNgVlNxwc6jw2QdF7cDZSBWwNfMg897j5T4rHuQolAN6emMkZUZJd/AHAN8ghF31zrJeOwi1C1kIkDHn7XlvJGdPobSGJo5hl7IeS5y90qvKwbz1Di2wl5KvZoNqL+H1tCkJh2d/v4uWJ7UKyDnqXBSQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982014; c=relaxed/simple; bh=edhtWkME7JcFuoloymgagg+bCTbdLj8qaR8IOWv4eug=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rDM/a8ypPWW/0ur3MuhLZr+w5f3WIBnbcMcXZD7xpQziZKjHzMR/0dwfWE9sY96XA/BKRMFTDY4A6AOvHPrm/16I49HzJIsBgDDOcDebEBfPIlUJHYwFKfqCNHYI3Ck7bIHLr08+fjTrzDv5tlEOzGmTFb/WbHm2IEP3qQ+rPdA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YDBdxKyt; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YDBdxKyt" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so50733805e9.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.linux.dev; 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=YDBdxKythOtV/plVb4/qjwHjsfpN+8e58B1B4WutGSs/QE3BH9GDrTQBNL9Et/25s+ 8+EVpvE+AAS86BNrz85VdCANjHSI8j/KwTah+xkRYeYK/N5V4y4BUygMqPyeIMrWr4O5 F3Y2jDYN6ZfpqgI5x34BUYcPv9QHkY8faQ2Ec0yDp55VrOI1T0NaN3k6te/Oa48VKceX 1LBDj2OqglkiMCTGY491G0TUmadmkuqAitkgYcYuZmaWIcQpkvn99s7bml+qRsJGR8QR bOHgDTIcG/Fgoh6Z2iDAI3+zSxJM0RLUIZRpxEH7e1IeRblwrsMLIv99TvmqX0psOfL6 ykJw== 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=n7UjmbEg0JnLjfebofBcjX4o2H4D5nlPygcTAsSBWBtQG4tfygE6+/1Mds7BYMbXEi zcFdFwWDsUZ3M9krgzXMnjUXPeHbMdK/I+MQsZ8MKOel1JbOPV0U9KGQ3YdkqE0GC1dq cbHt/JYyIui5jZq+xMWbynu9I85vAB6mtGnK28SoriNJsGEG7XUnFMoOmDD0HenyjDLR J3Ty9Mk9VDMw03pBPmmEccbJXAp3cLVjz8m/SPMBi6GVqt+IwQSzeQQj2LJymbs/g5bF JLKmvyEyhC4J8NDkI5rnWDWZMmstBzoa+nGB6g7Y+GIC4LBudKUE5E+31HBq/JT+ZrBv T4ZA== X-Forwarded-Encrypted: i=1; AJvYcCU+wr8gYjLVOqYitwoUuaebb2D1fr2WB8wwFgoUiLon9CO0OwkRdHu8e24zd01XjFXEBG0=@lists.linux.dev, AJvYcCWugEHWjzZhTdYCVWo4YB3B2ek4m3LU481CecBK3Of8HxaAxcNm2X9ye+cxJ7sfaCbyhVFfmRoW30kAfcc=@lists.linux.dev X-Gm-Message-State: AOJu0Ywns6Ppe+o0X2vUxeXBoZ8/gPWCIQSWwgpZRjaFV/7NjRyG73/8 rVX6em7A7fJ4nbO4KJdLLZcMWVqSGoqI8+ZGIoxcMJGT3mNgprXv X-Gm-Gg: ASbGnctZh4amyjj8heYL615YLhrKLE2x6+h1ljT5orFcuDXExEjkWNuwUQEsiQ7cxs4 vs6J9lHh4/J9E1FbcE+Hh07FV0bjpcTH/iciLkbIqLpW5YOA0A13cHgMo4J+1R6bq3yOGTj2mMv BKFXYazKlI/dWxEX4gvWwJu090FTwTjmzH9jmXD0qqsLkuaxrOvlXpcwHwysEvICb86M5snorDY y8pP9FlxK9N7tbiP7j8fBqf468WMC2RCAm5FQ+voUZzFy//Bllb3MztT2o1CUwoDJnD4f3M9LvC YTgB 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() Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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), }, };