From nobody Thu Jan 30 18:47:50 2025 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 AEAFF1FECBE; Mon, 27 Jan 2025 12:46:40 +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=1737982002; cv=none; b=DxzQHtbBYgekWbrlWBa1EBB1X1gLIFIbno5U8t9/hIkWuX2HYg5B1L9dJfyvYHA7py/cw28pzfFRgl7Vr8LNNi6x4Y3DqnbG6H+kVFldTChWTEgqXkqCoDDCrhyGDiZbIvrcaLnEMZorqnFcNs/VdKXL/ECFVOnu5fjGfnWGa2w= 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=F3lENvnn; 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="F3lENvnn" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-436a03197b2so28897395e9.2; 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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5UXpQLaAZHWEyD0pxCkPC9tyYvCIT3KFA3QpJPSo0x8=; b=F3lENvnnyIdBXJiRuyenMBlDOFUYRotmz4NYSF3Lvod3+HJPsvpjEyWRXg2f9SHFVt DEQtC4qlTlYK2sDilwEDRUt25hmsp33HQo49Bb2DcZTMFZvjrOMwuTbY2k+W+2lxx/sT SDGS13Vb5F4PAs3ljRAayhrg/z8JKai1Wp6NgrY+OEJXVTQWQ4zwAfbDy7WRJjP8szSs kWik1XLTT9+Pefai6YkMYmu8lYxTAIImYTiO/1AyxatFNm/wR2kmLPTfDNd5U5uVNHWo /VmaXDP5nE+fk/JtMmRsFaRi1T3HUepKn0J8fu6JJ+3nel51Ex4yMu8lWgGd4oF2mKAv 3/Yg== 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=sP7OZmjqna7do7mbyWcNtxt7hj/rQtZEyQ2lOGY4hrTHJRy/wOlEOEOXmdovU9FHH/ DIiot6ITKNPqjHqHG1T7WozgmK0DjH3nyv2YulT1MFRK3hB5i71Ll+CR43IlYqsezNtg eerKKDMNC+aB99LFwkge5/79SQRy11jh+hIAwlRfXowAEHCYBRnX6Eq5gvypPJzbU4mK xiCSUcpWgSqO9qQoGAt3i7ZiBsW66WR+Z0rBirsp/MlIRA4Bi3GdcyfHlldthwr+so7u sWautuKObrrHeZ4zrBDTOhmSkp+fOs2u/PhRJaZkoRrX+hIkn8+cPv0YR0ieCAuUbrxU eypg== X-Forwarded-Encrypted: i=1; AJvYcCUB2haBoRrUbeEJgSDnCVmd43AG4ZzZ2MfMdxPzhO48phGnCdiiPnYmf8iAuKAWFnTW+iHpBfTxKHX6yjQI87wlYOo=@vger.kernel.org, AJvYcCUdkyDJIaUpo3TkahO7mcFF6VYhD2w0E9f4ayTkT1i2XtMb3Lp7nWlnVVGsVqRIV51dY15QpdGB1jvv04A=@vger.kernel.org X-Gm-Message-State: AOJu0YzqpDTxh/S9NwSdcsSSEAyBpMKK7OKWYag+raXlxTCbOJsZ+VVu XLN30NVw6xGQeYUUFRVkMpSIq2ifBVvqKt+f4hlOFuLDHhkctnl1 X-Gm-Gg: ASbGncvwAs1SiQFPNRA/BQijdnqgUTKBcvnEHWakK31hR88d+DdKe+8R9YhscnBwhGZ TCFePU484EhLy8uNH1lvIqEt6apDBQmntCqU8/K3Rt4OZbrITWxzLtX9Z8Rn8r5szT+0075W3IC 0UeaMqAi+66tlpcuXyiUT+whoVgvIwyQB6gqkK1DOtAfLkvI2E7O5O0JDwAGIV4+Vqm17Ar7t3d GLUgcOV/rkpcs7Ib+kD5UP8cN18Y7p+fHbmltUd7MxiQSkH1mQDuIcC95K4OQx352g9ovBAv3OG brPN 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..3d43ed5db6078b3f07440f21aae= 6edf73d1da7f2 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; } =20 -static int __maybe_unused brcm_ahci_resume(struct device *dev) +static int brcm_ahci_resume(struct device *dev) { struct ata_host *host =3D dev_get_drvdata(dev); struct ahci_host_priv *hpriv =3D host->private_data; @@ -570,7 +570,7 @@ static void brcm_ahci_shutdown(struct platform_device *= pdev) dev_err(&pdev->dev, "failed to shutdown\n"); } =20 -static SIMPLE_DEV_PM_OPS(ahci_brcm_pm_ops, brcm_ahci_suspend, brcm_ahci_re= sume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_brcm_pm_ops, brcm_ahci_suspend, brcm_= ahci_resume); =20 static struct platform_driver brcm_ahci_driver =3D { .probe =3D brcm_ahci_probe, @@ -579,7 +579,7 @@ static struct platform_driver brcm_ahci_driver =3D { .driver =3D { .name =3D DRV_NAME, .of_match_table =3D ahci_of_match, - .pm =3D &ahci_brcm_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_brcm_pm_ops), }, }; module_platform_driver(brcm_ahci_driver); --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 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 DEC0E1FF1AA; Mon, 27 Jan 2025 12:46:41 +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=1737982003; cv=none; b=AuZLfXO6X9sWnvN2LrA1kSevLxrVJFL1NXLHlGtT4xuDQ+KNCRFyqIG45wJzZRa149sfvW61yBQ1lC7xhZ5ngciZrazhTgl73qgux89SgfcsWt5X4rTPzgTHelGsyFPNeIsP1Q1V+k6k7R6VcFcuCK2CuCapWp+9XDXnY4pFY50= 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=TUSlVUrp; 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="TUSlVUrp" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-43635796b48so27913455e9.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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=neEI1yakl6Xdd18M2E+K/Ks+Ljapr5chXpNCjeaLAxQ=; b=TUSlVUrpELIXQRpxV3FP+6Z/+Wsc4qaHtbNGAnUcqLb7xsMEAN7liCfjFClMgrhn7V FEW+sZBa4psVisB9QxD+i74KnU/CUJ2ysnzbF23EFJ4VOx6KQsONtUarVfJb/ubnCRWM jY7gduU3xXcqPe4nbZFpPA8ib7Icu/Ex7gj6kiy8lwdD5gB7S7bAbH6mdqQBxQLE91Ns wyrpqVoB7ptgRb4exJ2dAe6J79od5ORI1a4BLHXS5smpsADuqj9sgfGacjPXxGPgj6hv PAdwqE+JOv1fXn59IdWLt7dNbWYwd+iz7rrtU+qBOurNYgDzrlHnf/2/hrFEfa6+O+jE ns2g== 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=TSm1OsrHrxZj4lscJ63ABI/K7hz58p6VgxqE6u1kduPfNHo4VJdUvDfBbEtcxPAt+3 08CBbwklyUsNxWnv4Ev47h9OwfQ1XRuy4Lox/+YtQ32P3O+k9weKcBao9IBu7iasYOE1 7PihnTKDG/23I92QNlj/6mPyKVFTggxQYH93iwKZUIVDQCNxvLWlN+UF7rk5kAl/uCaT dmEn9QZCu8/uEl+geikvqVfbieb/KLeVSF28yMeKiNoH7qlHcmJlTLGKuc2LOnrGCFQ/ VIhMGiWLgOF+KQJhoC+0dYf1V1B/88Pnh4LPQ9XppbenyA67VHefchwloF8ovRPcLT6c PyXA== X-Forwarded-Encrypted: i=1; AJvYcCVtKDx9wI4mDzdZmY2+NP4sxLQFRqplEqmGBDbinsbYKaKXeKQzEke5P785XPq93GN103hyPWlCnyr4gkiV9QM+Bpw=@vger.kernel.org, AJvYcCXCzZ+Oh5p63/RL+g/hhQNcw3rZINUeBFqxvS6v2RSsaBToufSNUGdOaGSTiAl1ac7wUSmqRO/wNIZZVtY=@vger.kernel.org X-Gm-Message-State: AOJu0YyQFLhSylMs2y0XnjvOkTeGniuR+txt1exq6Hl47n5zVOc39u07 R23QL0/sW5IidJpni05WmTGxchK/7pUndRQcvc7eUTeG1ElUgs+D X-Gm-Gg: ASbGncvoS3TGl3CCEMlaPHgGDaFHWyFS7BS/59ez9pahyVdKvTrZKvREV+eZuwQqD0X 5DdgRCHxNPOSoeyzujC4q5kfCRLU3uEO07oNLR2h+olT5J01nHge9w0KsOYuaxOcFWAg7JFcJBp 0FfK38BtVBUkimmjSlfiqijr0EpkCfzECHVkHriwS2WfFnjpzl/L6foN7h6POTKdxBHoc5K4kzN qW9RIgNWYoi58dzUmwYL85IFmMC8yXhFWDN4EyQiRHRzl6eMOxNV2GgHx+8laNehwHTAEiI7qHa x7Xd 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..76e55f1f7db1f8349d696e92d89= 64af609532186 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 *pd= ev) return rc; } =20 -static int __maybe_unused ceva_ahci_suspend(struct device *dev) +static int ceva_ahci_suspend(struct device *dev) { return ahci_platform_suspend(dev); } =20 -static int __maybe_unused ceva_ahci_resume(struct device *dev) +static int ceva_ahci_resume(struct device *dev) { struct ata_host *host =3D dev_get_drvdata(dev); struct ahci_host_priv *hpriv =3D host->private_data; @@ -398,7 +398,7 @@ static int __maybe_unused ceva_ahci_resume(struct devic= e *dev) return rc; } =20 -static SIMPLE_DEV_PM_OPS(ahci_ceva_pm_ops, ceva_ahci_suspend, ceva_ahci_re= sume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_ceva_pm_ops, ceva_ahci_suspend, ceva_= ahci_resume); =20 static const struct of_device_id ceva_ahci_of_match[] =3D { { .compatible =3D "ceva,ahci-1v84" }, @@ -412,7 +412,7 @@ static struct platform_driver ceva_ahci_driver =3D { .driver =3D { .name =3D DRV_NAME, .of_match_table =3D ceva_ahci_of_match, - .pm =3D &ahci_ceva_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_ceva_pm_ops), }, }; module_platform_driver(ceva_ahci_driver); --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 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 D09F21FF1DB; Mon, 27 Jan 2025 12:46:42 +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=1737982004; cv=none; b=n3Q8j16+QPUpXygaZjY3G2lX+iueBCL/cHPesoyIQ95zOb693HCNW8qdogjp796xG0RpgKflRcQH18SuZz6ku76hNbJqOWggBLyKm9fQS2QmrNPML1EKSGDdKXiZbD4A8rP5OMy1UCySjeMFX0JhL7/CAVuO3FsHJ4wwx3TehWg= 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=AJooTlxn; 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="AJooTlxn" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43621d27adeso28990895e9.2; 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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PqAXhIk6/9U92F97+2iMV3noNDyf/KAzFHUwKQrXPko=; b=AJooTlxnhUmHA8Ly3w0D/Kg9STmMJ0dEUYoCbwniG+xNPgROKdlnp1pcH2O1UJ+2qu MqnYnbdg5Nz7pgNMteLTqA3aFe3h0qeH08ZbNJlhmUASQV6ujr/Vwj8qRV0jI3uWgRQB QcWtZV+E75gWX5Qb2GFLl7JK1/e3IswDMp6Uh2+jr+UIO7LdlW3Vj22SBmImA+7B9DsS VVAcNk7itnGO94eZz0OxCOTcuGlNxl0++UelKaE9ebox47qtd4zabcJJde8B5/xIgMwY y1Uux++o9OCKRezeHd56OhgIv0VjbdSVge0k0HLR+utM86UxEPLk049hfq+UFQaszdaf R2FA== 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=I4yO8gmh81V+espIkeNytYeNZicXBJb8Ntqpp7WxRPC/vqVOhMneUOkMRnV/RW3e8M 1FTyC40tpu+CX4xF/vdyFSQyHL2cUmB1EU3F4XoEGOhOnCMygKW9la8HLocC3RSZJTIB e316Zhsw5mS4xx7DFaZYMsrJW+5MSr7dprq2KTKOU9yR7tUw5Jqj0bKE4CRWNn5hfaTJ +Cre3nY+d7zCYaSOkZWLuBzE0vaJfjE5KBksRuDi40qVy5wdNTv52egy3DsGD1RIQ8JR lT8NJDzbJGSTemHbfAKxGmfWYqsta8ToCBf6HFRBZ+d9UTI+gxduQPZuwqpkQs2GBoLF F4OQ== X-Forwarded-Encrypted: i=1; AJvYcCUQOw8AsUSM/Yx1jydxedFvCcaClgxRcPJCfpqCyqV566hh3RZcUrDMX6YbK8U1SF/rt528jKFTBHvUhIE=@vger.kernel.org, AJvYcCWd92Tl5+TMr9Hj9Cv/OgXhzlM0EOFCHawl8x7WPt7EqiQDjx8/OiDZx25vycFYr9awK0xIrd7T5NLGrSVlRdFnIc0=@vger.kernel.org X-Gm-Message-State: AOJu0YwEqed5z015qUZMH6f+TwQeFVxFz2FY/lpb5Zs3MykMDDQIjYVU Z8Smg9Cx/x8yekKRznzrmSOxVDh3BTw9eecvHK1QXw8kVv8zyQzm X-Gm-Gg: ASbGncvMpGWrBMA31b/Dy22EBRkcDLwbcoxOiqBa7RAp4OZlG91KieRWUEPt4Plx/Nu aG23ySsOYGOpK3Bx1IMhjxDCTfsmEkulCHhuBEsfkCO/VcRwie3awfmyOlQfYdHpcmH4NVkfB/5 PI4CC+t2fhyQl+4G4wPDJv5OcAXrT6/2hWFoO8WkNPmtP6SDohRYRTJvxXLH/7H4cgo+9WCyRuH xv+MfZtoyuxeSEFyi/ApMkGyQCis66f2SwTI/rAk4k2juIlQS8Hwax3RBEytlczMBqxAIU2dwjF YFkR 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..698b0c30de0d65423f932ab3c3d= 95787b692cb37 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 *pde= v) return rc; } =20 -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); =20 static const struct of_device_id ahci_da850_of_match[] =3D { { .compatible =3D "ti,da850-ahci", }, @@ -242,7 +243,7 @@ static struct platform_driver ahci_da850_driver =3D { .driver =3D { .name =3D DRV_NAME, .of_match_table =3D ahci_da850_of_match, - .pm =3D &ahci_da850_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_da850_pm_ops), }, }; module_platform_driver(ahci_da850_driver); --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 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 7C1541FF601; Mon, 27 Jan 2025 12:46:43 +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=1737982005; cv=none; b=qcKaCYJmp0XaSKybQ6/hmCWl5ekdzvwCjaIDmNo2NcsiVeCUuQDPOqecjFVcprniPx3kJuOHYLxuNQWorkaAKf7MKUG+OfizwH7l9cTKN24KzfkcH0eGk7JU4gjN5ipxkklxSadBHjS3G/sabVytiG3cRRd7EVGRCDRQJUAJvus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982005; c=relaxed/simple; bh=MLMI+xe4jCIVViG+z4qmFWASYnmXjrbqAPj9rw3IXr4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PisbDuD7+juJLC08UpvZ+HpkLX7KxT/xy6VZjelfbLgxQljEHQzPoIGoVpRo4KpHXVY2q3wuUdl/aAbHYqOX7T5qh7UvxRR6j5Z2nZWNjYsz1nbCiNenVU3GJGxTWbOIJXK6zFQQ4TYuDxNExR4wRXVmXg2vebQkTllfojcPqH0= 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=ed31XF8g; 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="ed31XF8g" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-437a92d7b96so45292575e9.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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=cVfs7u/bC6+4J/CfEnlWiXT6DaEn0LhRfzsd996fsQY=; b=ed31XF8gtqZjYDbOQHGx+1XP2EKQpzO1bxuKPDbFzHAJBE5MI7Nmb3dlH236NzDCFU LUZCtxCbSQmzFKT3+YKE1ZAihOyWDqDbnM2/NMp/lJpWj0JAue4jBB4epoBzQKdzVeZb 2Ke8iTDHhgossrJSEiQBAGZfVeSrKEZTrlSF15YICJiD5U3QNzovU6x85f5e7mOZvP3m PCfrE8uZmtP6jKStqhZE+xZA3KMhmf3ZjPDmLZVi8gpQNg0+rVS2xoXm2cnY4pUsJkJX fY3aIwVWUAX33VHbUtqb8gam9mNE4aLN4CtqLIxJH03A54jvwb6S1DIUp5qKiTgaroCH n4eg== 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=mGFxQx/gP+UVL1dYMJLSLoAhmUvRIa++v46+5nU6AQTmtR2e69uVQXxssjucM2A+JF e8lfAy7Eo3J54v9+p1MIj05gcpV/SkAqe+v9JxafA//4MmDzrCDyhmEodINv8K8gOBFi xrcE9wg93/R4kckcAfgYP0+vy8RPV7eloxLxMPnr20Jf6Qi8UZOBwCKIdgE3o0gppOXA xtVaS55KYmcjwh606IxQpBjVy9Yvi/zy8cV+XLagWnD93O+nBdfhgtVAN3XzYPmpZhT+ vDYuwdgNclIPuQDcGNQ7ij90mwnnRM4oGw0rE9zbV8iA9Y88WMBOKYiN8clEJqG7DnOR HXhw== X-Forwarded-Encrypted: i=1; AJvYcCWDm+0e0hiprgGQkrud4JRoXGD601ywXCKynQORTFnzNcyxLgRXSOGtxWYD6JfJBtiK03vLVqJLLJLJPxA=@vger.kernel.org, AJvYcCXV2RTt106Anw4p0z11ZvlAwRk5/W7O79JkSCdy6V/7oUe2BJqLGyyFHQzEFjjn3CjDM2ELgQE2tVs8cJC962S+1DA=@vger.kernel.org X-Gm-Message-State: AOJu0YznLnsLV1g+jzEmTzYp+HkmFUYQ56yiKdvVCmIe8XN0hr+r4jB0 wpzjdJ5ocUdvsOyIomrxPsapOo1LfBSRDIPCf1p82/EGpdS46Hqg X-Gm-Gg: ASbGncuWIOysUTGGeVtot9u5crB3wu/4uAH6vwJQZLZhMZpgwYMYLxR/MoRJYXWdJnn 5fl54ZhXsvTlc9Hjr5zykAWrkyfT4uVHgSuu6FmVmkOpxuj6EIMt6Fpl+8OOnegzcREvZVJmqao KSS5+v3SFBEy2cCAcM0/0xNpuERjb1DXDigSAV7uSu/f17CeYhF3Ip4TQFrPC9iMKTSESzH/V3r /JQoHsUMeN3gsB3WwnM04NkorqFPlljbObTM9DumGZ7oIYgmjH0l4mhFZWFH/9J0PRuQDptiJjG gz5F 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..cb30a55945b8bdb1efefab19257= 5864220215d08 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 *pde= v) return rc; } =20 -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); =20 static const struct of_device_id ahci_dm816_of_match[] =3D { { .compatible =3D "ti,dm816-ahci", }, @@ -186,7 +186,7 @@ static struct platform_driver ahci_dm816_driver =3D { .driver =3D { .name =3D AHCI_DM816_DRV_NAME, .of_match_table =3D ahci_dm816_of_match, - .pm =3D &ahci_dm816_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_dm816_pm_ops), }, }; module_platform_driver(ahci_dm816_driver); --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 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 592831FF7D5; Mon, 27 Jan 2025 12:46:44 +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=1737982007; cv=none; b=S3/XrvN68XnV75rhouQ4qnSJaa31XdnBGifJddpaxMRDqPVWZhe+HmoBuEHYUmgi3/bRXZKqgfrIHHhnfz4mSQoAy+AFarBs08N663d5m0Vg9eeBMn4+0sT2VeGDus5RERXuZkahy1RmSDSwXdCp3j+yzJkw7c6c7mKFztv4sVs= 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=UVtaRYRq; 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="UVtaRYRq" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4361815b96cso28954285e9.1; 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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=nESEkcTInuMDz2GsfwYxT1TFIHgtEftiPAD53B8tFuM=; b=UVtaRYRqQP8skwq8aioKM0Gp6Q74KV1UaStDtomnO8yZqb3FqYRqPILT1aDMeixvWd kjqC46/nSasraoa1PVCD976FivhkbYabAcGlYR125rg6oglLOwk20JTsPEM3e73//You kYBLIHnKtdq5QL8Dwi72qJweo3RHLKzSM0VnbP7wBK3nnqoZA7OItgzaTs0CcE2B7BtK Kaxb5JK6PejGCMn0j4NhWJtxDx6fmtnBVyRSzmBN9+PGtnoVclnnPGThT38tPZuRB9d/ mYrNXpCuX7v5nGNJk0I/Cotv9H/r6vHmBOtsu+Wp5lX9T1tWYZaTBWrMtp+M/gEQirDy EPAw== 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=ZLiGt9k53VrL5SGPWklmldp1YnRrgOOYw3+JYVpcWuUL1eEu9BuaTNiq9p4GfHgOpY jjYYqByetlWx9VZxgyaJxSf/mtN1+9b6CQ9TzV2/9DBRlynji+r0owWD/vkEom89uias pbk2lmOEWIDhm4E01LnN3ZmzhadZshNwVi6bQxbYLOn5NV6eCnvszx3DiIzR+HWHnLsy U5Q3dFBIMF2Oz0aZLpSFEuef/D1obUoRlyAp1XPHxi1jpSIwvTGJVsJASnx87a8UJURE 7KZ5b/XeHt17NnashzUT0yE8D4foaaxjnPMhug3iGTU8Oj8CloxS8e47o7O6z2lPaiRS 6OkQ== X-Forwarded-Encrypted: i=1; AJvYcCWbfXa1sCt1JINKZVjCzoL6ouGKvdYSG7e0Nc/b/Z1mEPSSnBmI1MtArCGiWphiAE1/JeMHnCbj0qYLGCDQl/XMeJE=@vger.kernel.org, AJvYcCXbC2Cu9O95j1QZ6TYDcIWAHuQf+Lv1VgOf9uO/3uUFT38WPt3wIjN3baSc8O8Hptn16V05zQt3JcZfPyo=@vger.kernel.org X-Gm-Message-State: AOJu0Yz4AIr10b44qW4mJxs4t/ETf31u06gOYF+25JqsxAY9vSjLpGfS LaXysxV9x1dBzIQTAhZYl1aIKVbl0/3EVWB60wxeLudDzWyhRZ7G X-Gm-Gg: ASbGnctN5PVdhDckh6Iq8M+TdZrdtQOu4fgyntaXNUgbUEjw3rhUR6Dt+W7MruVbVpf T8JfgxkYo1b3s5MziD9/9rHd/jGa6QVPsl1j1E0gQEbhY0/FzKF19NE1b8oTvsIrSEgqkLIMf6r GYx4imK8s1JIg0u/fTb5oKyDc+60TBUorp7hNJiHb1f+ahSJEdt4mhNGm6uia0EzCWlth/nG1Pb ewuRGTCWPE3Xfm/NKJnNRXEJ+15QQKgjZmNMEaZFVyETdRXbpYTrj7i08y2IT8ZzSl1sTlNkbNg c5AK 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..ec75a16c630a79ce10ea98b16c4= 4c9a3908f869f 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); } =20 -#ifdef CONFIG_PM_SLEEP static int imx_ahci_suspend(struct device *dev) { struct ata_host *host =3D dev_get_drvdata(dev); @@ -1021,9 +1020,8 @@ static int imx_ahci_resume(struct device *dev) =20 return ahci_platform_resume_host(dev); } -#endif =20 -static SIMPLE_DEV_PM_OPS(ahci_imx_pm_ops, imx_ahci_suspend, imx_ahci_resum= e); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_imx_pm_ops, imx_ahci_suspend, imx_ahc= i_resume); =20 static struct platform_driver imx_ahci_driver =3D { .probe =3D imx_ahci_probe, @@ -1031,7 +1029,7 @@ static struct platform_driver imx_ahci_driver =3D { .driver =3D { .name =3D DRV_NAME, .of_match_table =3D imx_ahci_of_match, - .pm =3D &ahci_imx_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_imx_pm_ops), }, }; module_platform_driver(imx_ahci_driver); --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 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 DE9561FF7BB; Mon, 27 Jan 2025 12:46:44 +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=K92UzvPgz8NX8F832YLqUKo97N3G0UJRRptKBtUAxrQ0SrhxZkyN/LJNHxw/ZZeZHGbwH5iEoITbwj6AsIonR/MiZigerep4B2N7qJ/uWhqYChnJOPvPvWexLh3Lb8QPDCpnEvhTIPIq/jgB+H9j6l4BPTxAq57rZdiPEh/RcHo= 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=je0cDuZZ; 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="je0cDuZZ" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43618283d48so30768195e9.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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sjKGQCjlxoKyHC3MWupm0EMlVBTxZVB63YoUYqEoKt0=; b=je0cDuZZTjTm/KV3AH3zz8tJK8kHg4eVOZ5DtCio6kAR7O5WN2gDapUiCVtXEzO9Fp aBYHCpjUvNUoPjeBAF0h4Uc7OgZy6U3GKiC0ffrq2hyGpaWp9YiPGQ0twQlA388vWeX2 C1TrxZTpgbr2hnnLz1wQLqcO4LbN/+EOKZe/TDTfEeTs6OUv3LEGAv1eBXXuA4rsdfJc K1LATBOpjzr1DHZy8KXvCLMwLMpvj3/xmEEkX2YRtTT0r8Arc84XDks6PpyUF1FC3UtO 0JlidD99I1t0HeB28YuFkW+lKyduO44QoX9DTVN5NhToQaP6LIm3d6SX4NkwMttUQDOu YuXA== 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=AA72RRiSsiBUCM9LECYJE6f6FDcQgaS0Ww+aRAfxm6htFQIugsWtFqGgUd7yM+pHNY FYfm1xgNC2yKTTrwq/gx5+xC2jHnLVFMCy+cR2lSxpNaFF9uNYeXJ/7x0b0XQoqYFEuz TM0n111pA44WRRuUnIHttVdXuxwltApf/CdYvxSn+6bekvjZj3kRhdZkN72BemTOpmaS XStIuXx0UYjCl+xGFylzD6fNvItn1G+nRvJsvi0x3jiqtTttLklUcfLE9bjFEPZ+lowp qyf9+uD4ccSEAjp5wVHoJSE3vqQbDnKUQ1d6R3zCEQUNQbCorDLR0GOGPozuR1P0+/j+ zzSQ== X-Forwarded-Encrypted: i=1; AJvYcCVzozax703xjsMo4eUKxbZrfpNc6QSh5Pq6CKtb0E/3EddhmyqCgl97wZiAPbqZwHGoAE8ns0uNvM55ZII=@vger.kernel.org, AJvYcCXmTImqt/CTjknLoQ6fU8BYb23YISMYYPDAstDZ472reyf2psH3I5febXfhx92MfBEyfPYm8GvOR9x5zSn7IXSMVTM=@vger.kernel.org X-Gm-Message-State: AOJu0YypW2OKWUqvfhOnLrLGbzx9bvHlC6CyvBs6PePhOR0K0YMAgiv4 BOUud9xI1girVYX8AK6+qFaKoA816AX+K3RHp22OJspwUzjJVnKV X-Gm-Gg: ASbGncuqN0BnoyqEj58jga8ZuRvFzGnMEZd2ZAVfUQVsLB0NPR5Lf7WE7SwzNeO1G8j VuuA5UncxDatBjv/hRRT8dmGfb6jM1lPYzUqL7gamT3L8nst38+bZlZYi7ZJJn+a14qfMrk3fw2 45bGUiTsEbFWwNagZkMK19CFQbNBMT1HazWnQkfeVSNIFxGsEinTB3Yy3g3YjWnQYNl48FhG57r nMjfa6pjxv1JYQJ9V4GiWYWxNqePIoGckXPxISqA5xZdisYIVz0B6eZxg46qg5zA7jH94fIf3N/ cEWu 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..4afcf5e90e3b660f17b2eb0b1e3= df446bef470da 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; } =20 -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); =20 static const struct of_device_id ahci_of_match[] =3D { { .compatible =3D "mediatek,mtk-ahci", }, @@ -178,7 +179,7 @@ static struct platform_driver mtk_ahci_driver =3D { .driver =3D { .name =3D DRV_NAME, .of_match_table =3D ahci_of_match, - .pm =3D &ahci_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_pm_ops), }, }; module_platform_driver(mtk_ahci_driver); --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 039DF1FFC44; Mon, 27 Jan 2025 12:46:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982007; cv=none; b=q+0kBSvvmiIG7hGfz/0INsitOBSYUdqYX7Hv7a9Dh9yjUfaMT0IhFNMFMGZMY5GznOzCuXwJUGHthgo7mfBDlsEIIllw81fsNLjSvxVQBDUBD42llLlPjtCbjNCBncr+EEZMZMTmK/QZ2FMtQ1WqDpUmJR1ACPkUozuarAvEA/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=VZiqDkC9; arc=none smtp.client-ip=209.85.221.47 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="VZiqDkC9" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-38637614567so2058308f8f.3; 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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=99yQJvw7FpzRgdFhYow/5Nzmw1VclDAyJ3HG8KXeU6I=; b=VZiqDkC9sO026l/n65cpjsYFxHI4AtM6TUBvSVilBtIpmhK996fSG/7asNKPcqLT1G lStPS5sv9tiuZTOh7B3t74s/E1oM6CeUO981bdiu3NS5uIdMs8QwN6v+fqjvajqKsr01 klovjzBl/VQDWgEHcfuB9rprK2ZTihPCAaqFnADV4ohl7DRor5nZ6pjOaFcLrum85sk7 N8YOpb5+0yCIedJXjEqTRDr3fOTpcW4CmIiXD3yZml6GZ7CPoUFXJg2VaxRH4c6Lq9El 5hLt0Tm40MLxojF/I8nyYrE/n3LV7/TVCA7rr23rCGHEsDeZb08rSy0R9kuD5nU5sxzu GbnQ== 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=a7vHgrnNXebHOjEvF7y7+bYszznB1ayaz/+Bm3XjsTlXaDDoyxIjfcEwrX0EXjx2IU 1ivbScJwI5bp3b1dZ2KdALBb90WzYe9ZX4zQ0GMMuPyG1z6EEDj+/hh9ukvp8VEvP2Un uyECNjeOPB/8/8r9uwvoZOThz293u1YFCCGT9kn2q+tTaOMJAV+SH/2bHzTbUEjbGFTK LIwaXIZgzObLpJPpbkpqbMbiR865lqmA1AXIoBtPiTeLMkKweb4WUcs0m+qSoQnU40ML mi3n52tUe4lUeB3zGnCxS+zO9r9cRhwtvEXFVCIxgSf5wfVFdVHNArP5I68AKorPJeHM qEzA== X-Forwarded-Encrypted: i=1; AJvYcCUt0pYlbx40TIpBVAmtR/lPtZBQ7fjAIOfW0wSYTQJpFjTaTMUvGJ0CUsGaT/niq/80L+jhdRqKthLtKh5BnnpHpgE=@vger.kernel.org, AJvYcCVPMvUjKkiuHubPnVV083m+URStY0Y9Hu/mWgdB702OBjcLRtMPt5n9mvnigYUg4nyGz3INelD4S/yb0fs=@vger.kernel.org X-Gm-Message-State: AOJu0YwlsyZoyziKlHIPTqDiPohx3sDRaDGe5FCP7RSJS66by1EKq7kP 0vuRMo/Q/ZsjupBYRryIY9J1rFwc7HsgnR5IxuqXc9aMhGEmKVK07byAlQ== X-Gm-Gg: ASbGncsmuxwougA5LJv8s4mcKSznCKllk4nFJ7w0j38fKDUx/s1JY/Zx/dhiGmIdFEz GAc1ZDteIJa6OnNZsWAa/nH0w6FBN1PuyDYKsqbbYVQkmOm6Ml2a4tlc+G42eodK8j51qMMLBeN zQKS2zsYvIQ6igMXRfPDqj7suOr6xDw7B6FYvuK0lx0GFhUEsCYsNw521D0WyO0wZnWDESyIHz2 gUCuPfPZdOKOZrzP0l//UJtxTzdHElCB1lUA6JgF+OOgmsK0dAj3O3zqtvPp9cAjaQLSWh3ngNR 3Vvf 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..cd5d89c1902fab6c936aa04eefb= 461c968726185 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; } =20 -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); =20 static const struct of_device_id ahci_of_match[] =3D { { .compatible =3D "generic-ahci", }, @@ -102,7 +103,7 @@ static struct platform_driver ahci_driver =3D { .name =3D DRV_NAME, .of_match_table =3D ahci_of_match, .acpi_match_table =3D ahci_acpi_match, - .pm =3D &ahci_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_pm_ops), }, }; module_platform_driver(ahci_driver); --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 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 C012A1FFC58; Mon, 27 Jan 2025 12:46:46 +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=1737982008; cv=none; b=UFZUIs0rfk+BXAwOLxhgZizu1V2DLpP4Va2vK8ER2pwtDea4i69323o/Sb4vT7Sa4QdrAA06XA6FgrthwOz5Yc4moP9UTc4sA7fbLTwLwbQCW21OtkXT8Sj8XVBtSD5qGEEEcTwyqSQ5ffoxQgNw4FS7co5B5CzywZqcWBx14fo= 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=TmQ5F7cz; 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="TmQ5F7cz" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4363ae65100so47970905e9.0; 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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8oUDNS0fcrx4OaYIBd5riS15Hnp2550FLQmcgRsJgyA=; b=TmQ5F7czZWDTIeizqcpNkN9U4GD9lu0YGRP7dr/jCMF23/rbI04RIWIBPhb3RpCWcL rPA7PN0QyAPILoaYlUPFrEIMkxCou1AY8a2HObQ8jtDQRQXVRAKaZ4uYI5km/p2TJ5Xq a/sToPhGeKbnR5cp+WWOqzTTQ1Pv55eRTA4SicacyQQnYPPm3h9lio6A7hdP2JeL7QAW ny4nSfiBcnZoZfBJhm64Qrs0HagF9bDnLpJysmIY/XO4DZkSi+TyOZyUeP1NiwN6MR8j o9MRBnQqzcrfDX2WnfVHeOzL8yfqJP8YxyWsAZ7rUyjnlBjnKvE8FsnFZ72GY9XHC2h8 qoFg== 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=LoY2HPJqGc+HrBkkcA2fJt3cTXQV9OWS3BKKJMStbdj7Qm9X863eLu+oj7B+/0B98v PzrIbXPLHf2WO93pO3C3ftUhwN0SC3ALCl0+Im08KKibaQJ2zwVnp5cYBApscMtv53dV 4l0eXSguRK1LE4fFH0GfGxdnL2CJ9Jguv0t54ysfFaLwgoIl38hB5/XbjeexZ9zhqNqn tUaI0xFFLwQnD4YH1tjySpY2ecqIDWp7det7x52A/bQugs78z+E4q64EqMw/aeFYRcii 8VzjKeos51rHj1wyz+ogIyCRruQt9ARcHVYhRbXvBbdHdQz+CjWOmpRsA796VPrji8km td9w== X-Forwarded-Encrypted: i=1; AJvYcCWQTF+5mhAHNH2y/krsDb8OprA654dcNmSzqUNMyu/yKWQqvvFJO+W1orzF0ed+MrPPmHaQKrq5nYmEOfcd9Xf+0zY=@vger.kernel.org, AJvYcCX8KSEL+Nd5OBS4NZCcKF1VLDktzd9urNydQiJyWi4GAYeLkZ9qQgDZvyWfI8R4tpVwsEoe/soj0QvT/M8=@vger.kernel.org X-Gm-Message-State: AOJu0YwyXOB9kd28l6dAyRqKheQE79cCdvW6UqfhmowzJt9o7Zkv+kya qIVmDB6NQZUaJJ7IOzLIN82HotPcbZjqXHQ0NHkHSUCblpoZNvqN X-Gm-Gg: ASbGnct0XjH2QI86vuMUFwCR+a58PPIZa0zFfyFS2OxJr4D/ypnpfqHDmx6unjfFkjS InO6u9GrKkIIUwl94ZTzWelXK1oLTAvwBnYJNJfvPwu3eHV+bshvftVYjuMWnyz0cyWYHuftGwe P/FPv04/Nkua918L639TpFb+ZH7xz/RaaxNKQiO6PX1jlSfZOqXFvKiyBI07qtz6w7KzCiAt+wS yGgHcxb2MlTOrdfHW8Pk4GIfa1rFS/CRWu/NOdrJkztBlCKECHletAQ7X9NKp6N4068W6gy9ZbT bCP7 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..5f64bb8cd2e9c8d34403f76e578= 9fa435dce94ca 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 *pde= v) return rc; } =20 -#ifdef CONFIG_PM_SLEEP static int ahci_qoriq_resume(struct device *dev) { struct ata_host *host =3D dev_get_drvdata(dev); @@ -350,10 +349,10 @@ static int ahci_qoriq_resume(struct device *dev) =20 return rc; } -#endif =20 -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); =20 static struct platform_driver ahci_qoriq_driver =3D { .probe =3D ahci_qoriq_probe, @@ -362,7 +361,7 @@ static struct platform_driver ahci_qoriq_driver =3D { .name =3D DRV_NAME, .of_match_table =3D ahci_qoriq_of_match, .acpi_match_table =3D ahci_qoriq_acpi_match, - .pm =3D &ahci_qoriq_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_qoriq_pm_ops), }, }; module_platform_driver(ahci_qoriq_driver); --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 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 9B6D91FFC76; Mon, 27 Jan 2025 12:46:47 +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=1737982009; cv=none; b=NwGktwKovUpoNJrkE45j1Nb4tqRcriOVfpmjGzn/yvu0YPIG5/cobPFXd/Yn+wvriLZeWJhv7BHpZE4NpRWSy3PGXfZSsS292S2+jwh2LgXA6SKmqVX/AVWzideiR/PF+xLPIEK2L/C71Z+TeZovairufI+VeeTyfDWzF46KBVQ= 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=mk6whEi8; 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="mk6whEi8" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so45272755e9.3; Mon, 27 Jan 2025 04:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737982006; x=1738586806; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EXNi3EOoOoj09C+mWJNSCmBp9EDVd6qCUzZ8imkNOb4=; b=mk6whEi8uhxmGai/JTOeafaWkWyD5L5wJg5NF50N7I/+11pEk/cZyrWKpD4JgtVfEG dsrkYJ5gbl2I9do0Wxzd4mVnLWoEBrBt0iLbuEJd0qgNNbtQ4XZ7hLoGQrgYYSj1DA9L SkFDSH2Lul/aWIrLP+uRosAhuMK5Row97e0TTymg7/gvWx0KcPWdhmjiTzoX6+4Z6FqP QJVh0h/fq9h1AcXAW1AHQGkaC39Gu2GROQ+5d9lzG/21dR3SbHg8vx5z1rPkdy8NzXLe G8imuAvYFDXlBh4oWp6zaUyA4ep/JTe1CKPJMEKlTOzxO2iuVrZXGxcgMj9C4ZxluVy7 /lBA== 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=TF8Jwdyb6BxKb7YtfsoOb2+cAqYLuGB1BhxZ4q9B8rcy8zUIf3Lerlq3S1mdaKza1N ZPpsoRGxw+oEmbydfQ1vADSiGxcjJvnwrc+IXFmSDdcShdTqXKDJp20dhH7wiUAhz+2J UNK/hRYJFuMrJKsKK8Ph4DgXdKUUpLWglxtv3oCFxxoi3fIIwPGp0BAQlDYcDDBIcrdx RLyApulVoPWOZcDb84osuMXZ58Hif4n9+j3pDrmZWIOEXD7aB+JoOIjSkDXqIQ46dKpe 7x2CaY8hsA/p8PlNm/dqbWOwo2kX4eyA5To80POm8F6J+5E9cy4esQWf4MVSW46JKiBC InTw== X-Forwarded-Encrypted: i=1; AJvYcCW8m34HX1iUK3OHYi2uXLuxo/loW2FHTfl1EQ/k5s6LkGEBHtuYXUZQrJR3u2jQJ+XDiv5cXnOQ5uIxAPj68Ulf2t0=@vger.kernel.org, AJvYcCWjnhPnaqcJwfoK9SK+ae538TbBbRIiOyWOsZlK63bb2HJJhupY9qnlpWD/NyZTYQtjSuEL8wIfrPJgkDo=@vger.kernel.org X-Gm-Message-State: AOJu0YxYB0rMYmiaIgzh/LWWHixe/zS6vmTrZrsSG2fEWGmogLlsRH8+ 9c3Jcj9lcJGiGglZ5sBQBV5F1HxuT/wBAZkK+H4TIFmhjSFEiuyb X-Gm-Gg: ASbGncv7L2mISqRzRR6WGm4Oxp0h1IkfI2Az7xPhnJFg04pliewcm/LansnYFJ8WMiA ki8OPd/GwnumjuXouAK83CaGqyx1MIckZt01ltSPs3uY6ujrypBkKsQd0acGzdjnR4bR4Jb73wC 2uQMNolaoNEPDz0BiKGz+B6Pau/0d/IuVv5jWZB5I/asKmeLx4VVQ/JW5DGVMTOpAwx+gUv8N8D ocvx/08N0XhfXpxQTxKh4F0EuhEwQ2gmrMWFbZgishf6gxE8VlaxdiRlyyChcIY4m0rclDftIbs dELa 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..4b67f3aa5787de433c8bcc1bb49= 65a887709aa9c 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 *p= dev) return rc; } =20 -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); =20 static const struct acpi_device_id ahci_acpi_match[] =3D { { "AMDI0600", 0 }, @@ -189,7 +190,7 @@ static struct platform_driver ahci_seattle_driver =3D { .driver =3D { .name =3D DRV_NAME, .acpi_match_table =3D ahci_acpi_match, - .pm =3D &ahci_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_pm_ops), }, }; module_platform_driver(ahci_seattle_driver); --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 7408720011B; Mon, 27 Jan 2025 12:46:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982010; cv=none; b=rxYj7eWPAHav8MEoWhdVQilgmMhBVWfZOeTgS1VxEacIxEWAkClshRQhFdSl4Dy98ExtarFabeaTfSjpZEmZOse47Qn8qC5dT5LSR42D9vQdoq8uhgNqf0uruoPtxo93pNJy3BVgLd75og7u5i5PIVrDBctnV9YCemMTxHknoGM= 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=K34+yqbe; arc=none smtp.client-ip=209.85.128.50 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="K34+yqbe" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-438a39e659cso28279455e9.2; 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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=szGjXo1hYYSzRkz6HQhU4uZSzD6xW5bFqhnvJ2ebtpA=; b=K34+yqbejY0+G3hHxfJzCNICyVKAmg01VFDzKFMdFMKeHqkwrrbu/5Hk8X9oDGaNB/ oc9nD30X+5RIxNwfzjyLQEy+VwZVLJOgFsgAdwERAjfetsiYhOpL9qCULugR4A7FKp3H 3WFwRBw4FMurfaUztj4vb8e98qYqudbNb4OaqpbvXx8euGB+STVE1tsiy2koD532gBu4 IuNO/DjSTRohIsoCpDMeuTDQN+Yh4ms3g11fd1WK1ymh3eIwGLYD479AbPqFEkGWWytC xmz0ka19PtleGSMJHz4TXKDAwlU9VMJiLFXbzuAKZAKctQhgbsjp2CR7v19hpWCt7nrT uTFg== 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=XJM3NnRrfO7sADNvjkHLaK/X6jiehyM7wx9WH7uFcmE4oS6tYG197z382c5QaErlFx hFj2Z97X1pETvyohlMV7omwqxnxr9D7TMSl1eiEUx459p1AaTuuAsujHdTjVzdoIB2S7 DBXUKjxNCSO/uy9BMDs8jmeF8CCcL/i1ENuH00olKcBdcsDUKne+d16TQ0UyTmMw1YgL ExbKC8VVrQUcOE0GxF/prypwV7/JVhpf2JRMf5JoPqv5i8xYtju9x6aT+cjvNgvh7MhD khKbga84L/0pxKlLR+G24UOdvLU7qhg1tnF+6tqsoyz9XMcZpjsdGiOYEZ4nsIujtepy PFqg== X-Forwarded-Encrypted: i=1; AJvYcCWV26ZK58z8KFZB3pA4yanGYg65Tw8JOlECy/9g1DP9xkOiUM+FimKdl6y63RMF/YGu98nKWdffWWKnmoQ=@vger.kernel.org, AJvYcCXkeVQdQeIfSeczrv53ww9bosCfzLhv+HyNO9qIg3rWPn4TNrNElQ612bNyonacOOXern9TFhZOF5FT0NTtBY/h0rk=@vger.kernel.org X-Gm-Message-State: AOJu0YzUe1UuLElGq65Y96mN8+sMsiG0T6TPEU+1kk8Q0O7xi7wEjswY zx0BbowurbPZywQdrq37wN1SsHJ64i4vaHUchKXtD2Lc1Ku9Io1u X-Gm-Gg: ASbGnctsbKdvWK/oe76M24EhzQUH+m1c3N6vWK9vfWIjgKR3gX3wkZaPNLhL8oCWnw+ sPD2rWg7SqW6R+Bu36cirs0M7Q6SOSKF5P4qxsCnmiAG9xb6UCWKhBQ3xE+5m+kgkybX7L0Xx4q Ple2NNExwZf3lmL0+hr3Zk+Re0zpzDaOqvYJ93kYXsEcDxRIBOvzEbsmtzwTF5fn1vqaqLx+DLb 9jI05WmJUE68L9XNAB2AfXxqBLuWuJogSR15NIqtI0i8kbPXIRO00UbPHqX6RiR3IDHGbLtH+dT pT4j 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..2e86d4c97b822b6a52513dbe55e= 21851a58385d9 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 *pde= v) return rc; } =20 -#ifdef CONFIG_PM_SLEEP static int ahci_sunxi_resume(struct device *dev) { struct ata_host *host =3D dev_get_drvdata(dev); @@ -278,10 +277,10 @@ static int ahci_sunxi_resume(struct device *dev) ahci_platform_disable_resources(hpriv); return rc; } -#endif =20 -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); =20 static const struct of_device_id ahci_sunxi_of_match[] =3D { { .compatible =3D "allwinner,sun4i-a10-ahci", }, @@ -296,7 +295,7 @@ static struct platform_driver ahci_sunxi_driver =3D { .driver =3D { .name =3D DRV_NAME, .of_match_table =3D ahci_sunxi_of_match, - .pm =3D &ahci_sunxi_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_sunxi_pm_ops), }, }; module_platform_driver(ahci_sunxi_driver); --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 839BC200BB5; Mon, 27 Jan 2025 12:46:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982011; cv=none; b=Gy8KxghOVmudsFUi2QBMAaIhUNIBjxEYntnSnvqhDBJ2rQfn62Z2w3n8+B0oe4IcgStSB2epVKpbt89ZboPNE5DUkQJ12juYGwRD9Hr4p6GjUai4kRlqy9kKE2rqZXh8wW7RIcvM38jt8GCkURsDwlfaSQnzU6gIA9qkfYMHkl8= 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=K/dYAGWk; arc=none smtp.client-ip=209.85.221.47 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="K/dYAGWk" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-38a8b17d7a7so2259924f8f.2; 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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=KyTcZ2hwVqzXcvZadTxLwsKyE/CzZeUWttlSS9sOM8o=; b=K/dYAGWkHtDppoAHIU1WhC0Dfi5aJHLE7qUQzqvFQ0FSfdKbUrvDNZbYZC07Xe9RDh j/D7ggsJEdll58/bPF4TkC6tgx4A6DqyoHl1h+CP96phM9G4J1afxsUDuMvxPtc3WbgY R5qheySZ2U65824t6EEfZbLm/cilebLFsPPstAGI/pQcp1KUuUhjXkG7IyxWBUXZR8x3 MRK6pz0Mg2MNrc+gE506VNWA3UrJsJ1lR/bmrqgzJUOJmky4Ly7FKGxn5vO++ODwn2EJ MO1GHnhN5QxNUYpRMnNEJ1cnzXBNXhG+LEZPEYr7L+NhqbpjIgEhOO7V5AACmnOSvs+E lTMg== 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=UK0mKW/3BwzLM/3868w11tLY/y+4Woq5HWCTYqxRI6x2dKv2CS0GzV9Q7FbW3/PFIV 4qCM53BUeIOEyl9jkZCEnbDM3oHFu4aaTePBI+nyYdnrLrs6Xcyyn7Wni+QOoiyeBAaT TMWSUD1o2vD49pI0eYo15fpStDhXFZGspMIAISGTE4PDJW6Sv1WJUrpSkqe1aXYue1LB g/fYXpWWeiWTyCX8dXFTzVdB/b1nhQFV5VfHo9o7bNnMA877QunK2/SSwbnpjmGBF5ah jVOGDzDsTDJ7bBYGHTUTSyn5LEKCkYJFRZBKg9elPSY1GwaM+hIMKK/uftRXLr135hBf NPRQ== X-Forwarded-Encrypted: i=1; AJvYcCUCyNPCtCNqSC/J7KrqvWTji0IxfJPIPNXxGFrS8Qls9TNFcsS5oAXAbIwH3Y2fXq3wO7clRrQz4q/4nDcewziLQ78=@vger.kernel.org, AJvYcCWLsGmPWViuDh0R+PY7kvg734n4ImFVw42GxHlgTAzEag4IZ7XO5trgOEJsGgyua6U7LVZtE65bJXZWCa8=@vger.kernel.org X-Gm-Message-State: AOJu0YyFVXha8jFcN9zAbFw8zF/bv6pBSaJ4487qzQtMiwTVQT7TGwRu JepfgdKlh6IFezl49ocQlppLT2pGuDiyljkxIbwN4eMSLKSirDmO X-Gm-Gg: ASbGncutv8a/kVkm+dNg6u5bdlhpmFkaLM7X1M25m6mVIM4TSkoAFDfnecbuIau/Uqy Np6M4TkvCi0WbLolIDcG487Tce09HlqDv71kBvTWIgTrU0HM8uj9xcTXBSgNjEzTufzeGzJzNp4 E3BsG0jPOP/6tWGtYZ0q0CxaZrKSjalePBpH6uzcBzGY4gZl0h8K9bifl/xJLlTB2btqTZsIZXq DNVrYvYyZL6vBHCAmWFfHLEpYG778oiBdsXAoKzdRey1RX1RKB5HnDeWOwW2TFkWoF1q6/MGsn5 /hB+ 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..3ec03147a8fbe30e9f82c184d7a= 9c32cabcfdb92 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 *pd= ev) cf_exit(acdev); } =20 -#ifdef CONFIG_PM_SLEEP static int arasan_cf_suspend(struct device *dev) { struct ata_host *host =3D dev_get_drvdata(dev); @@ -950,9 +949,8 @@ static int arasan_cf_resume(struct device *dev) =20 return 0; } -#endif =20 -static SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasan_cf_re= sume); +static DEFINE_SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasa= n_cf_resume); =20 #ifdef CONFIG_OF static const struct of_device_id arasan_cf_id_table[] =3D { @@ -967,7 +965,7 @@ static struct platform_driver arasan_cf_driver =3D { .remove =3D arasan_cf_remove, .driver =3D { .name =3D DRIVER_NAME, - .pm =3D &arasan_cf_pm_ops, + .pm =3D pm_sleep_ptr(&arasan_cf_pm_ops), .of_match_table =3D of_match_ptr(arasan_cf_id_table), }, }; --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 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 51CF8201024; 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=VxL3BNfg3dqQu55XxkjbQli4nUQUFMW/SaSDuKU1I5LnEOm5wVT5kP992LFXoxNni7ZpbEp3rO5cZE0iqphCF19tKWpvfHlQGonXBeiy23EtwaHat1ZTbCnnqB5F3iQiG+YkRiZT8BYSAtDN2/LGLBqADFXArPZ6eF9FZ5awEko= 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=fUV0P5y8; 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="fUV0P5y8" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-386329da1d9so2220925f8f.1; 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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2I/g6DzNEY6MLWNE45x2+A3Pg81FAkaF8xBvQmIiUUk=; b=fUV0P5y8jHTVpkDGn132oYA1mQKC44Pi6S1aNxxdkXy37xa2bYbVHrGk37PRKUzx8f HtK6a4YBrsZpVsXOrUB7WPIZfIccSjNpPAWhM+0l5IbJkOUyWCp85tuPAFHGtU9w2nVS CcFoGOlP4pweJOn8Y0IYBTEnZQW3nlepKVyUgapN6gpA/0cdqnwS7Dx4Hi+eG+LZLiI0 bwL8UiXnvPKOfhzCHhFPTwr3SGBxZJK5ypoMeSOQujiYxSNkF0TeKC9ApGYJJIgWwpc9 S/oV7F5KJFQam+n7ZWf4bzqLdJvpOxO7lUE/Zv0XFDEZUYB5fwdznIAfizO4gy46lxhp pydg== 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=szbHWL6Lh7ppxD2xl+YZ21Uyofqd3PVGjVCoPDJdLGTrMfNy32lNvRHY+PRiOhnrsr zcxoXAPBeT0xS8Vpu1a3Y1S5X9F+wdsB6jvNyP+lyhUhM+vaCzKIowyvIDT67iBVy4Xh ukkr8/O+dgS1O+p8MRuZA2e+0KYzUy8QdrlGYL8y9/C7egN3wVBaRWSbDc1vQYfXFCF/ HHa/0jTpk2LF5Bksch1ZaFZTRoaFfb2HP45jNDjUDnfGe3KkapOanGF8RFfypkn9X5jk QBgV6087raaa2aWdgKgzcx++7pNLc+22jDG9muB3YQpxPcArBNOeh8QDsFyWpYDx+FZH QeWQ== X-Forwarded-Encrypted: i=1; AJvYcCW0BMpAF7e+v4u+FKs4tFROgdYjla5u3s+YIcgzsykIbU5ktiy7K8wAw7/BoydctblIN8SQyviv2qfKMOb6ICfShe0=@vger.kernel.org, AJvYcCWzGoiU0i7WAqOJQRPclHBrM5OSogK0BkXj5MeWkuucWdBRoSe4SBsZ2Xn9qDlbBSxnC8PXpPcwp2pt8ig=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3H9T//EqVPU7U6N0QpaD9s/FwpjqmQNzVg4NXpc5gZZ7AvTkE 4hs7sYv+cIHVPHJK7vqzOd5eyDET/1SwpHsXaTADKwEZUjrtWGxY X-Gm-Gg: ASbGncv8gAFWe37x5Q2VftImIWCQux+ZqUiedo0wQ4p8CGgoBOE0bubZYJ0aAxEKkfO Xrx/ZCJvLh1cq4xWrZ+ZqYVq9bxxJkYCFOXaLh1ItPY4vLmYRdRGnp/xjDKbAis3bk1pqGBjU1i n90xJqTJ1wZ54GZaKyNuj8vUWrN0H0QJhzcx7lyON2flRi2ZCCmHHEnp8YEHNPKr8NIAynwA2Cx fIjf2dTP5Z4CAQjckeR4nP8OTi3THaJwOV7yvVeGUbZEqmsGnx4eiRj03xZ5B0knOhjSujVZnoA N4k2 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..533de2782c37fb21bba4e4b8361= c48c0f2878175 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 *pde= v) __raw_writel(0, priv->host_regs + PATA_IMX_ATA_INT_EN); } =20 -#ifdef CONFIG_PM_SLEEP static int pata_imx_suspend(struct device *dev) { struct ata_host *host =3D dev_get_drvdata(dev); @@ -234,9 +233,8 @@ static int pata_imx_resume(struct device *dev) =20 return 0; } -#endif =20 -static SIMPLE_DEV_PM_OPS(pata_imx_pm_ops, pata_imx_suspend, pata_imx_resum= e); +static DEFINE_SIMPLE_DEV_PM_OPS(pata_imx_pm_ops, pata_imx_suspend, pata_im= x_resume); =20 static const struct of_device_id imx_pata_dt_ids[] =3D { { @@ -253,7 +251,7 @@ static struct platform_driver pata_imx_driver =3D { .driver =3D { .name =3D DRV_NAME, .of_match_table =3D imx_pata_dt_ids, - .pm =3D &pata_imx_pm_ops, + .pm =3D pm_sleep_ptr(&pata_imx_pm_ops), }, }; =20 --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 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 B779E20125C; Mon, 27 Jan 2025 12:46:51 +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=1737982013; cv=none; b=iG5RId1qzqXzrcTHFFYNlbAgYTRtwOZ9DXl32WMnmJTrX00kSsAYt5EWK0pps/2l2RTZ9b2mLKY8tZ7i5eCoqt7A6xZyKlEntxnyNbVEib/JqPqhW0PvpnOiVSkBCNllvE6AGRtpDiMuFtm+o9+Mw7bzz1/6STm5kHdA2OS85yU= 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=Goef9FWy; 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="Goef9FWy" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso27756605e9.1; 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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VcoOAINXi+2TT4WH3C7O8RVypx2rPa3EoGFaB3IYNWM=; b=Goef9FWySChN6AeujbQ/sG2PFYn7zQs21nGNKKb6yx5VRl+1GRhHuaJiVuVvT5hBGD Fe/eSF80+9Vzz5J7kZ4HXpFEkA1CnUBFKa3z8rhYVlzitHGhXOVa6h5WQCHoGMgY5vpY L0kKg5V1zMLB9i1NVxRK3sqJRT9Me/v/Zp16NNZ3Hzmdz7RLcFlILkTZoQ83ZboidCbO MbZGSUV5cf7KgGIxG2P2NufHDcWOckcA0s+V2QPjTSB3DVMIiX8QJGsWjsQInvaoVcWo 4RUwsdNg/F8CM1BqaDTFR0Mht7zAQAyuwiRF2C3vTVf0BKtTf0J2A/r/XpdRuHmh9zBs 97OA== 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=Gu2/aVJ9Z7T81Y0j15e1LsQa2vNViiQH+IfRufaRWWmlTOy9IgoUtXY9pJB7qaBdj1 KCU5EHtNelFs68u/q3vYS6s7GsTyVqB/y47oWXmSKhoor07KBCzYDJ/TdIoRvFfIlX8s DzOXvhZW2AwofRM3v5caWVBeV+SXneHFQUKotjrUi2YFYN2vnFLEu240DPAS+I21sQEW bRieQXlR5dGwXY6USUgLWD4dECVs8vg0X01+FlLIDW1HZJJzy6eqX5gsb3PRv7RrFoFS +CjAezcsyZPJKSXAq6FLeuWDq8OzemFu5Hb3YdsSMDva00+/Q31/3G6lDqblAHKB74yx tnhQ== X-Forwarded-Encrypted: i=1; AJvYcCUbZGONNKYsshphcwZKTjyL32J/BX91sKWGQdshk9OYh8oWYZSpnEGGUAAH2hccsHMAvvAXxXNwhI/7uI6n5Ky5opI=@vger.kernel.org, AJvYcCViH4quWauXHLdD6SAWlVBqvn+GVYKNhRkUgAASjnhfpghCFg7Qj/V4EyFctgDFa8AuUvwKUDC2JU7uEqw=@vger.kernel.org X-Gm-Message-State: AOJu0YwL6dBqln6sszNfOchVwxe70i4e3L8dHJTSLM92X4mIna383FuH 7le7gCIGdEMIVUrWqo4fI78hVo2zjVK9q1NEV77LcehX4pnpZ/XJ X-Gm-Gg: ASbGnct506CYy/doo79RgnCLIucMPbYJdhV/TBfC21DxR9+t/F8gHEs/QVldYXtUQ7p /QFsK+mPo+DREwMmvBGmDIn5kyjenejmvrq3Wm5hZeqy3cg/b3EqSCTUt5/XWaOxu2bwJHP1t4J KoVZ1gAO8jCsyrqBSrbpGrZeDhTsmMT0q0QBp/fP/EN3kaQIdQ+SHYmuAK6Nad/suF76RD2mHGh 95U/kWbp4Yw5LvNWqzcD+3F9iDZqrrGIw9r2muhsKUnvyWZy5KNP0gGDPUMUpwqLreVb27r3CYS 1ILv 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..c387e50485b974fa2f2defc0bd1= ea8cd43dc14bb 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; } =20 -#ifdef CONFIG_PM_SLEEP static int ahci_highbank_suspend(struct device *dev) { struct ata_host *host =3D dev_get_drvdata(dev); @@ -609,17 +608,17 @@ static int ahci_highbank_resume(struct device *dev) =20 return 0; } -#endif =20 -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); =20 static struct platform_driver ahci_highbank_driver =3D { .remove =3D ata_platform_remove_one, .driver =3D { .name =3D "highbank-ahci", .of_match_table =3D ahci_of_match, - .pm =3D &ahci_highbank_pm_ops, + .pm =3D pm_sleep_ptr(&ahci_highbank_pm_ops), }, .probe =3D ahci_highbank_probe, }; --=20 2.48.0 From nobody Thu Jan 30 18:47:50 2025 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 9CDE0202C3E; Mon, 27 Jan 2025 12:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737982014; cv=none; b=dOikbIKr7Yi9vQ3k2BsH1BIiy4PS9pYV23NQlWwQPVy/K/ZTuC4XVlIFfaj/5j2Wq/eyZe431xFEMqJeisHnyYNlUMfO93mrV7bovgY4+4lzs1APpO8NNrrGp3vuyH5fyAr5vwCQ0Yo/FQDyf0xD6BsgmNRXYOiBzTqRMUXJ22o= 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=euVtx8ol; arc=none smtp.client-ip=209.85.128.44 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="euVtx8ol" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-43675b1155bso50445775e9.2; 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=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=HoAOp3woacgQpHd2g/asCHp5UTA4pERK/Ity2Wb8N/Q=; b=euVtx8olYY1uv+i2/v6mK56YVqWdmuVtUsTJFzDoTKfi9VKP+jwHgpgoxVgL0EEYsM MZaQhEd8sQ9Rj0usaXTZ8b8NE5z+6SUodGv0+qp4zocp051B1zPgt9s3b554IdVx762P 7IMoKgAws/LSKNzXw9lkh1eppCvVR2T+Grvdcx+cVIL7WlyheRbQ+QHaFDRR0BjOaX6I EZuyTWBaKL+Wg7n/EqL5QSmYuv5k1aFKKCknE/gjM9OWq8CWBdVPCXhDSg1XTnuIs1TA z7uMbpNDXstab87at7mair0UmhA7jZY1Rr31Hv5EXePjxBOQWdwBtyeEUmizrscqnvWM NEcw== 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=c8fa+Shxwd6LZDbi91bT+ahjzvzcvbuYiHvk5hUcyMrmByMriEX/+XB4Js/afqRPPB clHVLpEZfZvtGHhoJn7xR+dU5iLTr3vkwMVfLlMoCF4oX58PZu3dMQ/GHmrwYhYjHDn0 XFo69bDWjpH6dlHYR3eO6WiKLN/8uJY6aw/0mXvBANqtK86AbOzfSqEK6jsPc5b/4tF5 vmIFSd5A39i5YjjFLXMMRlrU/m/uTxp4bYiPbZwjHSLByWqxPw4kNae7Ok9rAvpUk6Qy fhLgbTfvn4Vwbg3zxxA4Ul7RVvHMindifEVEr40EAD3+31D45zz8ZDQ3zIkrijO2QPek VuhA== X-Forwarded-Encrypted: i=1; AJvYcCU+t6ytmfU+niy+JxBY71cFTU6eO7DuTwiw2zXXSz2VWa+exyUMDOUYn66qY4RzC4TNoh1stwn3BaC2ZG8tKCghIPI=@vger.kernel.org, AJvYcCUaU/JGuH+PUFKp4KeGGVKm93VXs5KzWUQ+3eEC51ggP4/BmAb0rLA6fAN23eYXhLBM+uDKHi9mw1V3m+A=@vger.kernel.org X-Gm-Message-State: AOJu0YwBAz/2PJJFfz0vhvk+fmUBNslzYMRC/ox4uVtKo1TQ/rg+qUwF oZsM/F/pP/aCthKfVeL2s/9tw5cCWahSUs7rU/v6cfNxwzzVTG/K X-Gm-Gg: ASbGncvC+26ZVrIgRIYoTfP02lQa0vAueYxqtkhx9FkThff6v5Kzq1vgyWju5Gq+nPc Fsf91MSvLo6DhCFEyz5/SK3EIWI/EQzlPfcm7mvswlIkLDdhfH0YgN3zWc3TQcOBqr+JvTCdLzP fHXAUwf4Me1KRirnmo7dfjQ/NjmUD/kYDQZquGJWtqAztmv7zb2nwNwiVfA+ZpqvnmoFDH+bj/0 6oTv+bOUHd50XoRPc3PHGIWqwXfKY7bhwcdqS95yuhCiTiOhsuE+WiyIMMF3T3lpmSXItCvZ/EA sLn/ 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: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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..4c5f5938c12efc7c8594df40929= 15011e83f910d 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 *pd= ev) pm_runtime_disable(&pdev->dev); } =20 -#ifdef CONFIG_PM_SLEEP static int sata_rcar_suspend(struct device *dev) { struct ata_host *host =3D dev_get_drvdata(dev); @@ -1005,7 +1004,6 @@ static const struct dev_pm_ops sata_rcar_pm_ops =3D { .poweroff =3D sata_rcar_suspend, .restore =3D sata_rcar_restore, }; -#endif =20 static struct platform_driver sata_rcar_driver =3D { .probe =3D sata_rcar_probe, @@ -1013,9 +1011,7 @@ static struct platform_driver sata_rcar_driver =3D { .driver =3D { .name =3D DRV_NAME, .of_match_table =3D sata_rcar_match, -#ifdef CONFIG_PM_SLEEP - .pm =3D &sata_rcar_pm_ops, -#endif + .pm =3D pm_sleep_ptr(&sata_rcar_pm_ops), }, }; =20 --=20 2.48.0