From patchwork Sat Dec 28 23:32:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922535 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 F30AD2744B; Sat, 28 Dec 2024 23:32:56 +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=1735428778; cv=none; b=EKpKOC3J7WznKqjpHfc2SSAU5YOBQoEjbRlFt4hlJk4OapV3lM2SPz0hAPvcq7S27WIESFiz3Ol7pJYKP2kb5z6ZewQ1ZCvj4FMLZNK4/0sKFUHuRqzBYP4Ikota8lqfxQQprmXbqACvb+Lt9ImVGY/12IJzTwPI6eHjK+5ydd8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735428778; c=relaxed/simple; bh=pITQ3SISHmNURCP92MPtMIDVu2hGeerDTBhUOZa4ipk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ferV3yBQ1ccJxdXoZS47sZV6a4Lne9doRmyS97mfNZMajSkmaXz6JvQqv0U6mHsoBefdK87Vy9RD0tGIh3E/9gA3nodFqt1KXnwqZ2yEgyfdy9WMYCTWH5qYBxlnLSECvKV8WI+lqCFD8/lfMJhhvnV8AuGSydtRr2Dqdl1Wcj8= 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=N0h2kofy; 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="N0h2kofy" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4368a293339so40158665e9.3; Sat, 28 Dec 2024 15:32:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428775; x=1736033575; darn=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=wOndzP+gvkrgZs0qc02qdGu1OBtOTqc7KPMQjqAeOC0=; b=N0h2kofyyTrD89JYNJZmJEvY6eZM0oC3et/WGXVL/qCP1T1SFAotcvLOYH/0J79jsP YU1kf3vMEHDxRLOo3s9vWn1SaDpGG7NMO7rthybV+oCIRmvvlw1h8xz6Ig600gN154tX XUEfQyU9ZoNlzIcSWuMEbUceNrFQWsqIwhhQ8iIKnkt2/p8i/amEMiupvu+4cTixU9k4 NXVgMfqPiPzqn4Nwfe8wcHsmUewZjB/4LaGk+wmmm4XT94+a71ynkPLjMFwnaYjl0cmh tdDPzlm9r4vvHoaDAvjWtI/z49TyCeT5PiFpdkchW+mhDocg8hoedEE7H6/WQURfik29 bKyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428775; x=1736033575; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wOndzP+gvkrgZs0qc02qdGu1OBtOTqc7KPMQjqAeOC0=; b=WsiVZQ9+v1bAnDn+MxswZXFdLG3IB5YZjtmcEHk6fu6iCaIuDB58y77URiDGPuz1pU EUrvDwMc9vDYdXL5Zx33GSA12/2wqDqIbxrExWIs49hWwvBxsQdLK0nD4hswaTVc4r5F //UG5gAHpM1z6kNg+XOw79N8PZAE9WuVjXCzWxYd7ZbHOlO80Vlt5dUL5mwcR+QKXcVO AKqMVPIC2waMeY6te1BEOpPu1E5SRqn4HLTWlKxl2vqEzs3OE5ChdmSpRvrCjYrcIALT rpMuPo21s6IcM1k2lsEOYgpvaCar0HBjkVTZbNztIO09p8quAOeN33GA7xODkRn7ilRN h95Q== X-Forwarded-Encrypted: i=1; AJvYcCUf2yM4r1hNIC6vCUCaBrCLHKbwiCd7kpB4vKgKCpMqvIxgzNnvDmGDuRaiRfO3ANSpP1zXvaxRgJI=@vger.kernel.org, AJvYcCWn6Yjrt9OUnV+B2LV7KZpeuH1DZQ1P5X2kO6idMe/p0t6etLcl3YCtiRvMl05O6L+Y7JNWwOa+dKEgNdrr@vger.kernel.org, AJvYcCX7BL7P/vj9928bWxwoAQ8Xydfeuz1gk4K4OCcAtMi1eQ6UAIOiOHTQB2EI8AollmfbHN05xbswcJRU@vger.kernel.org, AJvYcCX8OQaHCsibBieHAWZjXmJhlKWSiOi4FmdzXKN8AERTMrkCbU7Q6j4fupKRoflIxiBBJmO5xIvIt7FZ@vger.kernel.org, AJvYcCXWiyrjXHEePKczyR1aT7WLTLULqAOYQIYtz30jEOP7/e8OMk+daRysD72e/QXggpkwa0817ZeR@vger.kernel.org, AJvYcCXtww5QucPDwE03M6bUaxlj1PIEbnmIz0Dz0MVEaKnV3hYmL1m9Bwr300RwfpsjeDqXF+eKNUpr+SnA@vger.kernel.org X-Gm-Message-State: AOJu0Yx7VMPfNki/oT2vEo/ijIRrm9lxW8FRuNH0T8gn1KQOTjOfaxpg mlxr1z6bAA4HdqbI8hnEuKjNG+MTmp7Jb52haLyhU8AxHcxjMRtG X-Gm-Gg: ASbGncvvmUQhPlqZ7Kl6QFrprSuBQgRMlT62JWT0HGQdCeW5JKnT1yEVzas4IvT/qIc zkQZAsvIkst0qhXShemy2/8HNU+6kkuaLHpWIgjJqXrHk1zCOIgod0LrScbtBniE54M64HzJIBi +APmsfFkAht0BgFokvGSyqnModmgkSpaUp0jVYQHgyQfldDkmyLPkpHF/z5NP9eJLbLIVn8VJtC 7ofVTe5I362nyBqtd6dxBrDPEOhaGARWBd3FWYeD+aWE/rfM51CR+3LPw== X-Google-Smtp-Source: AGHT+IGe8Rwcmuo9VN1Lkb94sZXMSVEBxRAkdBXNxIt/1C+WWqsmcYg0Za15vXGe3lPDFNIsmfP2GQ== X-Received: by 2002:a5d:64c8:0:b0:385:ec8d:8ca9 with SMTP id ffacd0b85a97d-38a223f5c0dmr23948509f8f.42.1735428775256; Sat, 28 Dec 2024 15:32:55 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8475cesm25785410f8f.57.2024.12.28.15.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:32:55 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:40 +0100 Subject: [PATCH 1/6] usb: dwc3: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-1-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1573; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=pITQ3SISHmNURCP92MPtMIDVu2hGeerDTBhUOZa4ipk=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqk5Qr8I8UCU+eXHkVfaa5GP81eSw5Fhp3mZ d3XzeEUBu2JAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpAAKCRDnIYpo1BLC tSpaD/92t81iuqxEUHcsYt5/Wd4eQOM5eEy6ZSir1T7uL3om6KgK6F9iIjSVBlFj6kEbB25IJ/h Bt1oVYolifnCrjPORvWAOSIw3MWCn1Osds32OjHMKm3W8nWcwB8bDoCMZBFhtpioriPGVKTjdZW PlEXPCH2XKcSdDdqB0Tw55BruLDg+f56q2fHv88gAjRqPgt7HS/IpOc/cdp04Z2k8rv0DL7Jg2M kUB00pqUBL0ghgILZkXQ/ylZJZSSQhyN7CeVrK7R6YBmUDf14wnLHEFOqj8Wj6hKR2cILhfftu2 8x1MvvwQrupvZZoPTGCvPnt/E9Pe4N6LTXHY9fq+1a3Y5jJeFgnaYmgk6vAHEVT54lTshPXJ6iK oFdHkO6bjUb/71rNJrug6/BCIr+7VAkCnaMeK8NB8EmKeUNmo6pgBgzpLexiQrardLh+J7kq/pL kpaJR6FSoq/KZWSzWtpyHQ9r838IHznXZ/gd3O3j4h56wIsNKj1xC6N3fRBGoqGr1GAiwTAb1qb dOzLYzkIRXA4IlPIDj1CbJ0Lvf1y1Fis6k1vwl1Cz77RCpC4wa7/1uoB9S198DgNdoXvy+a/5QI oMezUW+nv2ob40fcPfwzr9abnCP5iFLv/OINnqBukVW8iUUCjreXiHUuLpBflRfZD2ia/9uLqpa bHzvuymCdM0rkJg== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/usb/dwc3/dwc3-st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c index e16c3237180e970c184dfdb147c8abd46ff429a3..ef7c43008946e15b72d88aba4941dc52bf0788d7 100644 --- a/drivers/usb/dwc3/dwc3-st.c +++ b/drivers/usb/dwc3/dwc3-st.c @@ -309,7 +309,6 @@ static void st_dwc3_remove(struct platform_device *pdev) reset_control_assert(dwc3_data->rstc_rst); } -#ifdef CONFIG_PM_SLEEP static int st_dwc3_suspend(struct device *dev) { struct st_dwc3 *dwc3_data = dev_get_drvdata(dev); @@ -343,9 +342,8 @@ static int st_dwc3_resume(struct device *dev) return 0; } -#endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(st_dwc3_dev_pm_ops, st_dwc3_suspend, st_dwc3_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(st_dwc3_dev_pm_ops, st_dwc3_suspend, st_dwc3_resume); static const struct of_device_id st_dwc3_match[] = { { .compatible = "st,stih407-dwc3" }, @@ -360,7 +358,7 @@ static struct platform_driver st_dwc3_driver = { .driver = { .name = "usb-st-dwc3", .of_match_table = st_dwc3_match, - .pm = &st_dwc3_dev_pm_ops, + .pm = pm_sleep_ptr(&st_dwc3_dev_pm_ops), }, }; From patchwork Sat Dec 28 23:32:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922536 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 3FEAC198A07; Sat, 28 Dec 2024 23:32:58 +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=1735428780; cv=none; b=OQeoWyfPUVgB0jLiEtu0fIi7HhNH74kVB4LvwAKWyc6/NMPa2R2NVI37U0ntPubHjUuzxH2j0Ie+uwcEyt/ZtVNRsTyxAGPzcsqmUkfngyZEqmgkxYnwyx5+D4gMY+7Jn+Vy1HifFbYNI+Ap6CfRul8FPPXxLSk6h10abOoEbOQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735428780; c=relaxed/simple; bh=0LBKnKFkf/CBAf2vV5CqDxilt6OKT0uPTamcOeeAqdk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WhnlaFlh313hgVtbo+GJXscWvl1HC+LDUdr58GqWS5epXDBI62TFFpUV8eBGB+lCU36+QcsDsqJC1sxkxKeFHAISMvRufw5TIaSPFAd5xRgtHZi/1630PbKHMcN2zRVZ96Rs74kygqZ0LOa1P8soIpiUQ4Zwz6MWq6sayoo2UaU= 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=hIRPr5SZ; 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="hIRPr5SZ" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4368a293339so40158785e9.3; Sat, 28 Dec 2024 15:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428776; x=1736033576; darn=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=LKu4EPBvLsopgOFZpl7wz7qwa3Ue5APX8+1kt9ZJzXY=; b=hIRPr5SZJECh5H2mCWGhxYTlsRQ3WMhzG4z9VHImVjFeQ5pLtXmz1kqMQ/dm/tRxIG 2oeumPtmIUpaEhe9OX2Jnky1+iKdmiS4WhAL4aL3qqDDAmBrRS8HZNizBSUX/ajDFb2D 5zu+1ZSGPRgjwPqQLe0GULYbE4nkt6b4fdOGFjWfJNx1Fxlu8XQa/O7G9j3AJ4S10dUl r9Dqh6jN14cWJTGULvpP7LA2z79EfPMpdw4CfGucHYLWLXHczgMfgANYBJOtGPJxUoPR srs+PaQEDHGvj6tiWn/nXtVIybVLT+56GdeCYBfdBbtnAEGdMnX/QXyhD1tFYzN+n+fA ZmJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428776; x=1736033576; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LKu4EPBvLsopgOFZpl7wz7qwa3Ue5APX8+1kt9ZJzXY=; b=nCjWsgQawf1cf0xM5uV0Ef2z2r2W8uYetZxJBrUAogbnnndUrjsOElro1EX4iZYBJ4 2sXQtpNt9gCTvAF9VJcFXnMwFOcUfJx/ru2askpN57HJG4lzW9imUqsbaXwdGBeO0vlh WzGBu1TB0044G8GLhYpQ5z4bvHWcsb9PMs7YN8T2jMYcW4Ef/Ud/oeWSo3MrPO6nXy6l 0/OwjgX7LTaTT7+VvilrwDlOB2YvF/GupNw2xTybfjTIB1RvZislDcNP4pJq6yWx5Dek n0MPQBIPznOLCPV7oDZXwR4kuALBtK9belYbyXkH50hWqPIKDATqRGbwVZERVEZQTjor wneg== X-Forwarded-Encrypted: i=1; AJvYcCUYbLicokbTBZ6lHOHFLW/vmaV7s4czugK5DTeQP3H0OvD3k6p9UUNeBniCGVhp326/leWKNgqU@vger.kernel.org, AJvYcCUi8aW0r9eIEiDsJ3vtQvePhVL7ehF43wCo8WgBF8LXN2Dbn9wG54nQ4QE5hmlFx0w2STkNZZf68zm7@vger.kernel.org, AJvYcCVBZGJat8+okSRt6xhagY/YlVCJDcWe1/KjVI+VLSNGvzbah0Bxp1wyGANBKFR/pszV5vW8rAcsXvFj@vger.kernel.org, AJvYcCWDpZ9nncLx68dVzVIsBYLsAtt5VOoT9y9g0vot6aU5Iyw3wInLzmOM3KppwfaNvdyx1hXGEBhb+dFx3s6o@vger.kernel.org, AJvYcCX3O37RdN3yulDvhYLAQe7KR1AGhsCiFqRGca/fo02GXaf4QBDXjjZUIPvZF/3KOs5kwaNy2DYW60+V@vger.kernel.org, AJvYcCXzxAmTGubB47IsJH6PFnK/00WrYfxHo6Eff6/01lSGToybFQe2IzeWf7ochpyNQUTthPFtdgrfuRo=@vger.kernel.org X-Gm-Message-State: AOJu0YyaoMzIfiFL3v5qqna+ksNb+abkF4oA80Wrt/YWEle2KTOqe4qK soMvBfYr5BovbrUAJmWRwHVuIarYNDqHN+/pkxF58XWV7uJs6dUu X-Gm-Gg: ASbGncvSE4/9TbznlwSsEwqROYRrXopLvUhllOkqtQLtnH6XURkGokqOQjNL9mkPUtt K0dPGVQCi3l5a94XoGiN8LA701JIKKNcOyThSK4odHd7sK7cTPrQSNKEZfHB7JXQD126lb0QTtk GHawfpDyhlxIR0s/JpO65uOubNlIjwQAHwfBrH4jHA8fD1sI4XLXQG+F9mI3C9IR+3bWtZgSRhT LH33dR4QjmQzu7qfv1t/2rNqNoCom62G33KYoHmiR1Mxprm4ShZeql1cA== X-Google-Smtp-Source: AGHT+IEFMVt9avPwZbEkQECNlih0Tj5apwRe3kcAhJ6WkS9XD2NmI7QYDZOlN1PK+TzmG7eJVzqslw== X-Received: by 2002:a7b:cb14:0:b0:436:90d4:5f3e with SMTP id 5b1f17b1804b1-43690d46037mr104959305e9.6.1735428776211; Sat, 28 Dec 2024 15:32:56 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43661219a08sm312165205e9.25.2024.12.28.15.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:32:56 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:41 +0100 Subject: [PATCH 2/6] mmc: sdhci-st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-2-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1605; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=0LBKnKFkf/CBAf2vV5CqDxilt6OKT0uPTamcOeeAqdk=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqkV+oVyk//zTE8gZslpR+kKKOstF8wTCVuV TKvMYBC/MeJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpAAKCRDnIYpo1BLC tavPD/4vrOzvBtiiJvKt9sC4OUwOCDInW95G7gdKLGetgoMPL841oWQyr9G/28XQniPi4LdT6m7 v0phn8UdBtytA77ajXuapY2/8ME5HKafYbBvhAVJsbGqHwDq4uTWZDV38h40Ll7odOwUniCSWHm Bt03pyV6HdwF64lkyn0pGoDN579sNaOHWW1uzn07Yo4mE+bV/Aa96/I87xWaMtiglRUNBuDWMeK SHLmnTlNcvlBc3MjUhsPmtAeTnd9Hevaw5MHK5Kq2jyg4Ixm5eLx9Afar0rxLpPZiO7U89upIRG UZLL89qGSMcgBh4TXwESAAnZ48AiwQ1nCxhXne5Nug+Y+XVvpA1qIZa3qvecraz8aTQ0W6lqPEm yZ+U7m770MJmH9PWsNGpGQkbpV/m0m/mpqZwmonu9Lqdr1qz/4pewLG3+ZT1658XgOqwnj+cls8 ZqtnvNYqKMurs9OupShrezeNUioevn5bHYv8QlHIqU8KvmJhhd6ybeqchpUPz/n/kuMIyh3YHJ8 mToQrF1qUoCjt8RAZfqivZo5GVNIK0Bw8t677CoM5UhnFNbPZmQ934JFNbbdJCbYtwj0XfrIhBD MAzzXA+NSAoqzC4S+u2/GKJYki+n9kBcqr5N2nbH46jPNqxOsf+vz1K+b+BDhfuedcCzn0ES8mQ K9j1SwhQL4jmseA== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/mmc/host/sdhci-st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c index 4973e08a98f87380325566a6b18878dd45e1dc30..901e431976ced68d5b6e374c2dec93c9fa821d38 100644 --- a/drivers/mmc/host/sdhci-st.c +++ b/drivers/mmc/host/sdhci-st.c @@ -447,7 +447,6 @@ static void sdhci_st_remove(struct platform_device *pdev) reset_control_assert(rstc); } -#ifdef CONFIG_PM_SLEEP static int sdhci_st_suspend(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); @@ -494,9 +493,8 @@ static int sdhci_st_resume(struct device *dev) return sdhci_resume_host(host); } -#endif -static SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st_resume); static const struct of_device_id st_sdhci_match[] = { { .compatible = "st,sdhci" }, @@ -511,7 +509,7 @@ static struct platform_driver sdhci_st_driver = { .driver = { .name = "sdhci-st", .probe_type = PROBE_PREFER_ASYNCHRONOUS, - .pm = &sdhci_st_pmops, + .pm = pm_sleep_ptr(&sdhci_st_pmops), .of_match_table = st_sdhci_match, }, }; From patchwork Sat Dec 28 23:32:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922537 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 4FAD319993B; Sat, 28 Dec 2024 23:32:59 +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=1735428781; cv=none; b=nzOtACer2kw/SCDRuCQG0VAGLZPfXT23ZK6mipfSbyOHpr6dvtv7q4Rwr2FAuT6+pYyyIkxxidX3vKi2I9tcBj0jsLRmvd9ZMt3Qjp0OqEY7j4bFoadPqwPDk7cKX3umDt3uGf/J2pncjfXUe2OxwK+w5PNH8SxxTQTVD3WFaIw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735428781; c=relaxed/simple; bh=3cZeUXTp51nnkA0ehfcJ3kzlhmQfCuKF9N0XQDOcDK8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=h/1hSlqgOiEOWA6vL9HRo7ioZWeDih+Y6i5N+/eKA7N35gQYLkCREN6fZWqQ5zZ/Qg7oKrZeZOjnrjEZzggWzG9LFW7JxYIiqMVPzyCfs5mfNr80hbMn7pCgl0wIEyI9WoO5r52vOn/6R9SD/kGBW4270Pcr5veKTBgErB+0FEg= 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=VWdWLo8F; 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="VWdWLo8F" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so86680075e9.3; Sat, 28 Dec 2024 15:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428777; x=1736033577; darn=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=PxV9VtPwcOjfdreL/ElR6ztmuVaPGRx7ZtA/COvnbHs=; b=VWdWLo8FY++ZbSCC3YRs4kBiHQq16hA+/buqK8qy3Z+74XHMY0WSOwbCDmu+tsiX6w HxcgQD/r1+idvve0bcjTyMLoEfanlQy66BpanDd7P898HnThMN/O7FtbEszqzB/kacNE z5IRl38a4AK4h8KAKFHgn2JeEpqgiGxMz9aVRJmUK/RNhIks9CGgowV5j7MehVJLexz3 +DB4IpBMzi3qfhFCB+RgIWLH/VnRZBi6v5fHASuKIYs4wseRaYSpA9ldos6EoqV1NAFj XLDFT0/WW8RNHVoFWytNNzpDnOCX4WdjyZIyCKse3jGSfOFXkvXg5j69oDIyKFGqZQRe H8eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428777; x=1736033577; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PxV9VtPwcOjfdreL/ElR6ztmuVaPGRx7ZtA/COvnbHs=; b=uNs2fBYSceVFkAd0nWr/7xO8XqDoFHfANCv29Qji077prBy29s6Nq7vA2rSbMsBTMi CpPGtTyEgpi3ZI1kkvbOFB+KlQGmoY397UmbvhpW8BLS2BUdLWMuxFq+f51EQFV0Rx2c zZTDLK+Ag1XnH+AFd26SOyt8GkNJIy+OqSAd5ggAJ86mISnONdkYrzvG9JJyKoZSEuR6 3nIlEgKjBvKNsNUVDZWWRP6JIlRufiVZqXdOj5i8o4iNmXrlVidW9MfhzWRajYYKY7xa /XygcCTd98ot1LAS3zIHLP6y/yc0hzn+t6Bips+r3RqwYoA07lyMb5FBnNbojrLQ2Xb3 SC8A== X-Forwarded-Encrypted: i=1; AJvYcCUcOl9MfsL+KB1FSV+aGDL0C5OpMjtNSOTEjSmHJe14I4SEOz6iw+aT8C34QoaEDZiQWpbBc7N/jsM=@vger.kernel.org, AJvYcCUizTtoiXfO9IIJ6HVFf+6MjDJAoEvPO8xxgnMW84Kt5UYFWBK6v+k5jRzxzYnzO0G4B0wDty/n@vger.kernel.org, AJvYcCV7/aEgfTJR5G1ybgASWRmJCaM+9VYNX11nSGjb8Sj0QiBKgdPqINMO5WrjKERWAlqMjznOtuGD1hy4@vger.kernel.org, AJvYcCVsu0tQdcSfn3XAhCm8SCf7lF4ptTX5NYHYXAQHx5HcALch17VB/zoZOhuEwKsBJCrEzVkwJraBi0m9@vger.kernel.org, AJvYcCWZ+iVq9Vs0AvYR/za66SRI7fLxmIZuAiptoyd4o+E2H2k7YWfJn2BWpPtDfbicJBmYHaQhSpfgumgr@vger.kernel.org, AJvYcCX1Vj1TSBZTXcVWP2gAiE/axpTZPwRCTNtIju/ynrZDBmz0ZHOoUKfWYzUeEWTG6vG4nPfw52Bo/ZJkpX50@vger.kernel.org X-Gm-Message-State: AOJu0Yz0LgVjWfPVEnxrYwX5D+oNNNT+jIfgedY2AI5mINoBNh/iBsdK ZklQPCCzZJ9gvB/9eLH/zUhNHNe8mp4qCn/8okcbZW1aSotrHUk63WJ+Vw== X-Gm-Gg: ASbGncuG5p9DNRNervjRQslIqV/ZbjeGzVl9v8Z/EI4j977kdzp821qc99tfGCSYGQt UtPFYaR5LIPUSGevPNRbaALQ68bWbut6C3FDhNmti6+fxm/uSpqK4nI5+fsrpAF6rbSG/TGRneE 3gWvzpb03oJ7Y8Ve5Z3Lw2hrp8Qtotu5orkrkqR4JTyPJbK8GYlpKUGpvhRp+7w0scZKNx3laPN vhX8j2/TzSlIIQkMLvEyFMc5DV1pxGD59OGBATxfZA80oh8sJ8cq52CWQ== X-Google-Smtp-Source: AGHT+IFXB6mtbitt1Ty/iT+t/Wxyvt+fr2CPLQ6VRcW7h6pu2iRFzuNW50tyST860x+rxbR3cQJGsw== X-Received: by 2002:a05:600c:3b20:b0:434:fa73:a907 with SMTP id 5b1f17b1804b1-43668643bccmr256788785e9.13.1735428777279; Sat, 28 Dec 2024 15:32:57 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c89e528sm26232100f8f.83.2024.12.28.15.32.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:32:56 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:42 +0100 Subject: [PATCH 3/6] mtd: st_spi_fsm: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-3-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1621; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=3cZeUXTp51nnkA0ehfcJ3kzlhmQfCuKF9N0XQDOcDK8=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqkunV0YUrJmo2OxF1WCeGsLT1QpLwOpvdep XrGjLg1MXGJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpAAKCRDnIYpo1BLC tYhUD/9P4jzfqCUfSrApK6lmfba4E7uCY6h7SzplroCGW1ScAmboJ/iYlxhkMHbAYfLQ771Sy5X GApAEGp4oyZ3wXnMKt8YIdaZ6hmJTzeBWIsuISUWUx+2NFEqQQ3NuKR9fyjjJOz541V9Sbrbhj5 dKm2bsvCeg/vFy7uEo6HCGmbFFrdSMUOahladMZaNiFyssMjt5B+Oxo9WuGPd1qecQKGPVIsqS0 Rnlrb/7nduNaMV6u5peS3QPgq/rW8qodw5k+1u7YDrMbvU3jOpDBbNkZ1S0sNxBnoJ8tnAjwDk/ eQlg2JFElPRIvOnRWXngSOzLgvZR/nHaFpYZiZnfF32pvu0VFABQoQ1JL159abwroLScvR48/C6 6i2RMm5ARJf5RdkBoYai3xU93SvI1qxjYucRkE3uj+mMTZ0PUrftZ3JZ23DMZZG8WnPNfh2EOxW xWL1/3THYy7Wl7qHQ00LPyMT2NRocPs+0Tp1wzMaRVMj0q6ciGjqJ+QYHMZlHbhSh5sBCuqRwmu 41acQELy7x7I3k01wrZ1sy4TLYyni32a1fvdO2G/DWSvUSDhFTMkl2dhQUfKpv0VrXcx331yS/z p0to76g+3pC4HZPGpFzKof2JGxRm11hvlh2tzpvL3RFL3eaWjrtMGvmM8gXxvtCcmh8Ha9CGnNI ovHV8xs1qQgCQKw== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/mtd/devices/st_spi_fsm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index dba584fa2a530b8d32eccc4ebc4d04ce01582ca8..f2266145b82167a4f7a063bcc7815115815483a1 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -2104,7 +2104,6 @@ static void stfsm_remove(struct platform_device *pdev) WARN_ON(mtd_device_unregister(&fsm->mtd)); } -#ifdef CONFIG_PM_SLEEP static int stfsmfsm_suspend(struct device *dev) { struct stfsm *fsm = dev_get_drvdata(dev); @@ -2120,9 +2119,8 @@ static int stfsmfsm_resume(struct device *dev) return clk_prepare_enable(fsm->clk); } -#endif -static SIMPLE_DEV_PM_OPS(stfsm_pm_ops, stfsmfsm_suspend, stfsmfsm_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(stfsm_pm_ops, stfsmfsm_suspend, stfsmfsm_resume); static const struct of_device_id stfsm_match[] = { { .compatible = "st,spi-fsm", }, @@ -2136,7 +2134,7 @@ static struct platform_driver stfsm_driver = { .driver = { .name = "st-spi-fsm", .of_match_table = stfsm_match, - .pm = &stfsm_pm_ops, + .pm = pm_sleep_ptr(&stfsm_pm_ops), }, }; module_platform_driver(stfsm_driver); From patchwork Sat Dec 28 23:32:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922538 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 1DB9419ABAB; Sat, 28 Dec 2024 23:32:59 +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=1735428781; cv=none; b=jdpigNwPZxhbcrN5FXvdcScjkkNgOk4eKqxqYWlEg/caus4Vo9F2Opsa4a66/I7ryuINaN/GrQNx2FsUd7gEnMY3Ihay4EvvW604mUFd0Gnbyf5QcueGMVMj3KFS4HnDtnpDpdk/QP+BsOa1QWeMOgaui8xZLzzQE7FC4GajFZk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735428781; c=relaxed/simple; bh=puiG5xEDdJCtQ8qmQzW/cyD8qGWndW0XH0vnx7xw1nQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=blCUz35mab/BfhVt7KNQucdBbmsgN2F2OlaR8EMzCySQoDSTjtdWpc4iRSrUDDigSUgadVjRvSrQKoFAifhNeaI+53yCZTaX+m1ORPsEvfWdbmGV7k0H1QUZU9OzVICxOiV/srkeL7IfvPGF891iE0I7P+iZa+M2FKeXUALfXmw= 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=IXakVNvi; 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="IXakVNvi" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4361b0ec57aso82351385e9.0; Sat, 28 Dec 2024 15:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428778; x=1736033578; darn=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=DfubF/yufWY092c2cPTjDejWqTWBBJxWn/OStLH2dG0=; b=IXakVNviFcgiBsuX+vS7TeyEw6xXFx+ppP/0sx23IbgX0DqnM7zT1NOiQcbE9GX84B EfCp7FNdWVK3reW0wuMlan/+OMk+o4cxaOEmywm6eB160acR3mkuhxC4sN6Wm184c/F6 zQ+9CygjMj8DOuvZ8JRC2jRuNHRikLk3FlSOISp5bwMsDnEVYxlcZDikyk81bQG7igfo sFvleq8tAiBJRk4a6ElS0QTALPjVoANo//lw7wJggrc0icg8C3sm5E/D8T/B+qQqcHya Of6IMh6clT2kJfyVSET8ppcdzVdtz2lIP/Ld7BSzuz2AM8vQCWdPsoZ5OxKJKNY4RJTa 0+pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428778; x=1736033578; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DfubF/yufWY092c2cPTjDejWqTWBBJxWn/OStLH2dG0=; b=bCL2lI6wRkhTR/0PM6vLmHFdc9sbQ0rcxTroL7C95ebNX6vVKUlrTRkbTc5cCshXHn XbGM651nm4U7zZJuxuFHbla6zfAH/IqK+dpKHtv0ExSe130S/7crxH7oWbW93V2RMXOs qMo4Qc/2YZwroIIy6WtIlX4X1vMLVsmEkAGC7Bl+Cs6tyFNjrkGfeXLWa8ccoIoE505n fU51+CuFLrCMaDU4u9aCN8z1Uc8+1heyaLzwA1C9eDgOThW8BEmQa+ryugc2l0B6MskB EtdVqaabPtD34XYcl7Pq/+4tiTZIeGLsK4OlBh4isPOnCeISXsorfAbkzJvRyunJZ6A/ OS2Q== X-Forwarded-Encrypted: i=1; AJvYcCUmHvpX3ufmqD3BWcQlm3oRTqZ4TCfiiqH5/4iKPj3x2YSxCyS14lR7QhpLcex7qjbuQUFAMf5TOCkN@vger.kernel.org, AJvYcCV0kf+Xy5phGLJjEcCLHFaOt1+ghG8aFmCP+En6I9iwuZfvZhuRcXf317fVfbTnNCkTnWiQ6415JaAqIQQ9@vger.kernel.org, AJvYcCW4oModkrX+U9XoXZD4QNZoENIVLkdF2xaCAzbITIDVT1KzfeVadRXCpCdn/tNNqwU3ZngK+Pu3uo4K@vger.kernel.org, AJvYcCX0v0ol+4g/KdqJrX4x8iZgScU4G1kBePFG60W53sTo6b/p0//+kJsQmGe1e3Qo9JgmpISEEvKelzuH@vger.kernel.org, AJvYcCX5Dt4r30YXZy7pfP0BuOmnq+O65tmV5YO9muylX7U9Bq4THhmGZdodibCNXFGGk6w93BJWO+qh@vger.kernel.org, AJvYcCXWMN6BkvnAz7tpFktD39pPoNzXkE7RPcE4fC4n8mtDFBQFLi1c1cSK28DL0iYCdH9ov1Qu1J4bKTc=@vger.kernel.org X-Gm-Message-State: AOJu0YysvOterIebQz4F5q5sYwkl0g09X15Q2pYqXYc6z/qdzUJuXkI+ nj7PmKEVqQ4cvZXOXbvfxhESYLN4REM/5h6tbAjoQrYCGhor28NYgnXOLw== X-Gm-Gg: ASbGncvI4gF33yzzoa7c0cEDupQ5GiCmynRYqhYhsuAv7QllGqTQwRSuNkgqCkmvgE0 p/kmqrm3YkR40LnxSTrKhgfE9SNsFBSXi/PIYFbq0w8eH6neoxIMN4qfO+FACfZHhtQDryMFyvk 4UkAzD7c2OLXv/2TQ5267VCvib6KHwABL56fAxoApT2Qzfj/mnR2AwvC43ZopLvlJMnZ+pjXyMU cbB3xCUpy/nGLttHw8qzjw7qjFz2jwnYaVrNlNp+PYMZeBMIvew0bLqow== X-Google-Smtp-Source: AGHT+IF2ClbgecNehGE5fWNtec9ewXlro34blBIKLgyQx5qEfdd7BFdxq3aJXVLuA8KbNB+TQ/BMPg== X-Received: by 2002:a05:600c:1c9f:b0:435:32e:8270 with SMTP id 5b1f17b1804b1-43668642f9dmr262491285e9.14.1735428778151; Sat, 28 Dec 2024 15:32:58 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436612008b1sm307077615e9.15.2024.12.28.15.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:32:57 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:43 +0100 Subject: [PATCH 4/6] ahci: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-4-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1549; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=puiG5xEDdJCtQ8qmQzW/cyD8qGWndW0XH0vnx7xw1nQ=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqkWao0M4f63BMEsxa8BRIQnaXQWygL0phkf tdecngcH0aJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpAAKCRDnIYpo1BLC tQJWD/9qfpDmwRN6zrCJNqZMU53EqDWlK+stpQdz2PxOgWM3IiMDfRC+jyRnvxeiWM9DBojy3CM eVzk/pzBMVdce6RrqEdBvSXEOhqvQtC1rwivdehnng1VXuGW7/WzqQ16lvPoYhaOeOSnH7v4S/Y 5OJd33Yy8upYHZK+CHEDoRw7Y1JJcLzOGrgX4WjCVSnnCwzlncx6xZwhUkwtvI1FO18X5Jhgjh1 yX6RZxXVxYc+3wdbKn6W9rDZZlfws37B0DfFdap3GBWMTfkNCgs+DGNgoEuYhZcMQxmwx66wb2o 0BwEpi5PF9IGK6bHuLEEX2cr4gV9784GayGuaSythX1VMWzo4yVE6o9ETY0gdEdQUx5oxA+R5iZ QkPazXjn8VJIjnJgxjrVaVcCjDt/PomoWdeLWNdPtcslOtcTqTWVA3PxK3YuF/r4p+9hHbaizB2 gnOwVzHIaLIKng0moZCBSHKUejWzwgkT/D692Qnwo1jzezsRFXBAHYBXxYC47FPUqrrNVLZ1IGW LSc+5kqpqWoJbf/J6FUi77wzfUAa7wwVSAr/kgt0ep2DMsyTxaWYy8N5KKmBIYr4eXWmdCr5IUv 4HsYTrNo1Tx7bDH04sfmhHiXxDpwdR5kjuWexjioIGfPKVsju98eeYPPJy1R6MG0pnsXFTTm3AW 1UCYQhk+nmIQ2hQ== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/ata/ahci_st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c index 6b9b4a1dfa15bb6f395cc742f25251376b869a21..4336c8a6e20871fe25b61d6e2043fa15902b3559 100644 --- a/drivers/ata/ahci_st.c +++ b/drivers/ata/ahci_st.c @@ -176,7 +176,6 @@ static int st_ahci_probe(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP static int st_ahci_suspend(struct device *dev) { struct ata_host *host = dev_get_drvdata(dev); @@ -221,9 +220,8 @@ static int st_ahci_resume(struct device *dev) return ahci_platform_resume_host(dev); } -#endif -static SIMPLE_DEV_PM_OPS(st_ahci_pm_ops, st_ahci_suspend, st_ahci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(st_ahci_pm_ops, st_ahci_suspend, st_ahci_resume); static const struct of_device_id st_ahci_match[] = { { .compatible = "st,ahci", }, @@ -234,7 +232,7 @@ MODULE_DEVICE_TABLE(of, st_ahci_match); static struct platform_driver st_ahci_driver = { .driver = { .name = DRV_NAME, - .pm = &st_ahci_pm_ops, + .pm = pm_sleep_ptr(&st_ahci_pm_ops), .of_match_table = st_ahci_match, }, .probe = st_ahci_probe, From patchwork Sat Dec 28 23:32:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922539 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3222A19CC08; Sat, 28 Dec 2024 23:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735428783; cv=none; b=hrgllqeDPE0bLJZlPrOI5pL/sG1g+tVXP8BFJyaMuz1N3e1Cuh8vnAF7RQ4/MjWyljDvLpVylr48SHMe7GsFkK2SbM3UVQVjWqdR7QEJr847FnVH0EaMCYihe+ot3+YziaE3l7IRS1fZpZ0hQjVob8TXZN7EtpbvowcWNBc/BlU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735428783; c=relaxed/simple; bh=Xy7AdPQ3XNeeLhZR/TYDcrnRFX91WkBoxIfX4qqZmFU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Tw3jh1RjUWZFIQ5khoE+zdk0j30TYHmbqa/mXxaTX/mV7XnwsRTNBnRCKhzxzVHzLHPw3CP7sEwjHs+COMRAiX9oUuYazh2ivBIipqWKkXuSWe5bFlu1B0UAMIpNLjwXdqu2i7m06gTb4t0QCuYRRP259pkTRhPI1U8xJlRMc44= 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=Zj4C9qLR; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zj4C9qLR" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so93264835e9.0; Sat, 28 Dec 2024 15:33:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428779; x=1736033579; darn=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=NOT7K8Ya5QmS9KbZEm2dNA6PzTUyykxaRlEoFqze/Wo=; b=Zj4C9qLRZkTauyAzggzOqoO0rxQQ85v6XR6BvssL45u/Uz0r8+jo/VZvMeplkZyXhW 01jnKNt3MLWg5OoLA+COOA3ifjy21pTwferdRTYMdMe2DcKdtTKaS5XNC/lLzkE4WOf6 Id9hW+k9vZzPnjJLp9M3eh91WcdIZ6XrsS8AygEktd5OIwq2fQvVIbh719txTWUN8Q7S Pb9W/rZEjUmbsS8aQPR/MSawh3r/CG9OuDUBP5luu7SxlfElnTqWc6YOLtPr4pV20Y07 tHyZ3zj/kbQx4/o/sf7dEtPfonex2/zl8APWjlTkWgcg0uqi/w4XiZX7zSGJLzlSlyYL nzqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428779; x=1736033579; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NOT7K8Ya5QmS9KbZEm2dNA6PzTUyykxaRlEoFqze/Wo=; b=GvRDxmXuEoqhs8IDEmFQTY+qRPMPN8TOubytchxjczya+vKOb4ZZaFpmBroMje5aOi 25ZTM89RUmfU/bgDG4W3cHGRxEDI6SDRz+Yhvd12UVK7iF77s1rdrxlGhDS+TpfetBjJ Zm1sFqB8yIgLhE5YFp+irLLbIEahhg4Nf2AHt/jWX+ZZl/3AN/Bph1afgrqWhlIYYwjl ts5NRLvyY37id0Ii7fbqpUxeoBIEM7HmP6HulPy5sHWOREENWN9RnG8ZLBWeojCYAxMv TY01b1u8r2XNgIA0QpLYXRiPyn5Tq4cATP8uzE7AV+/wNgheY5VW5RdOEUn6Rhk9QcEc +khw== X-Forwarded-Encrypted: i=1; AJvYcCUP7I6CMuetwNtPSwRxiOJxFsiBosraeC+O0Vu59UZxQqs3oEg+4NAgwMsGHKtLY6I+oGGi456N1uc+@vger.kernel.org, AJvYcCUTXCulyQtaiEZK6eHZHAjOh1z7tfIj4SjImLzkRugEltMBegc/Gzvq7fnSYl5Rpij3oJLeihy4245lOx8U@vger.kernel.org, AJvYcCUTsiET1EIdSwBdxv2Iyr6CQn0gVyVcQkjsptRbEovu+yAy8xTpg1ojxA+KNH1kKgKEoLdcn2fou/Cs@vger.kernel.org, AJvYcCWMz1hExuTkrDKW1a9JUiIlbOS86vQ5NL3MV0WKRSuJsMtWbmstN6exOSD/8Bwk9cfuR6P/A+lhWUW/@vger.kernel.org, AJvYcCXkgR63ATtnaBpGjNIepOLw9HUUmxN1kehqEl1uaAJjk77kON76YuYhdLZd1FvvQblolL1rWPYuM18=@vger.kernel.org, AJvYcCXmBd2AbMddzYHmGw7bxY00Pz+Bw3fU8G0enm36XuukRUhGmme7VrtJPqT0PTWTTFItjYISiv8Y@vger.kernel.org X-Gm-Message-State: AOJu0YxqpWZVIZqc8uArVtkHI5hT8gKX2EiPPOKT213plQiqUknAWeig gUC+YrbyGsFmWU5i/UWZualKYvChDmchGqWBSpLJ5Qp61DfLF+u1 X-Gm-Gg: ASbGnctpEgwarxeDU1ysMRbboK/QQZQPimEIR6mNoKNEMIpx92HVYduDHCa52+oE11Q gtCwDR7KZIUpytnERTrfHxdd7aqldhwb/1Xf3KLjI6CQHfybQxweExK2kzSt4KI3DriQ0dsyV4x iwCxcq1iwA1kd94ryfiwxkjA7LHstiHO/FXEwaJP9PovxrPXzCxJrriHll8aD4YShIDNOVCnFyk t4Hw8Gk7ZVuInuZWLDMYehxl57fPcHN11rmvb+BTaL9/f+7ycB6xUboCg== X-Google-Smtp-Source: AGHT+IEDx7wvGkLVUnT9AMtJHUHuNgRawRAtN+qgnC0Cj3E/aztBEivykLbd/wn9yN327aAFyzdA4Q== X-Received: by 2002:a05:6000:1542:b0:385:fc70:7f6 with SMTP id ffacd0b85a97d-38a221e1f67mr24709765f8f.7.1735428779386; Sat, 28 Dec 2024 15:32:59 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c8a6ca5sm26538490f8f.86.2024.12.28.15.32.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:32:59 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:44 +0100 Subject: [PATCH 5/6] net: stmmac: sti: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-5-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1773; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=Xy7AdPQ3XNeeLhZR/TYDcrnRFX91WkBoxIfX4qqZmFU=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqkdCM7I2+fjKtHyJmXuIMRiTT3ConPrpraf j4VH3GYg+CJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpAAKCRDnIYpo1BLC tWOLD/9mLv8T49Aj92DxuFqK+5R3cczwAA+SNhe7B2SwXvfVYYd3E77Y+/6R7e61V78SrnbI8gz uaBNqyvNBthY5MeF0I+NbwVeOCkA2B23GaLT+QSAAgc/lpqQ7wFVR3ISSUhZfAT5dU4co5VkvHM xnEYsquomiIFCIsoOVZw7fvrHUaCfpBwiyPXjs+jaTzfcq++bCknVVo0bsn9SrV9v6OIEzL4CxJ 2Gec/Ah9nHgtAISBD8U11Ay92zy0/x8J2tmMEkLxjOFcmqZmJyYB0X1eyMts89qT1Xz+qxVwJ4b eGSEySEwcjMA401vbYtcTwgiaRaERA8MMXj2OjAznA2N2n1aswBx2ElmwHm1wBW2FXPfVapYd9u cKDauqd2bZioY7er4gOxCHnT7cvL+mGopN2wMggQ7N2mnGfAnVhUwo1BvvKnALB6XZUt4riUWco td11vz8xganX4BAkgJUrdabbCavIB95y7cYJOMpKAnQGDHRALdO3K/R9opffcvMi6xvmOl/amaJ z/7BF43VuNbdS0NTjhHxD5V9G5FlkeT31KscpPYrGl4XpRe4HaazkrXfMZr0DbWSBESGgi8Rj7V +MXQFC/biruMtBy8YzlG9rLxu1xkClx8ECgKGVnRJBpUo0oBdpjoD8/QjoS35kjJWNjGSlKyI9T uq80NJHRbLeVYQg== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 X-Patchwork-Delegate: kuba@kernel.org Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c index eabc4da9e1a985101643908d2efdb0b4acaa9d60..de9b6dfef15b3d0a503a3b55b3e9a42ee68c6141 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c @@ -313,7 +313,6 @@ static void sti_dwmac_remove(struct platform_device *pdev) clk_disable_unprepare(dwmac->clk); } -#ifdef CONFIG_PM_SLEEP static int sti_dwmac_suspend(struct device *dev) { struct sti_dwmac *dwmac = get_stmmac_bsp_priv(dev); @@ -333,10 +332,9 @@ static int sti_dwmac_resume(struct device *dev) return stmmac_resume(dev); } -#endif /* CONFIG_PM_SLEEP */ -static SIMPLE_DEV_PM_OPS(sti_dwmac_pm_ops, sti_dwmac_suspend, - sti_dwmac_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(sti_dwmac_pm_ops, sti_dwmac_suspend, + sti_dwmac_resume); static const struct sti_dwmac_of_data stih4xx_dwmac_data = { .fix_retime_src = stih4xx_fix_retime_src, @@ -353,7 +351,7 @@ static struct platform_driver sti_dwmac_driver = { .remove = sti_dwmac_remove, .driver = { .name = "sti-dwmac", - .pm = &sti_dwmac_pm_ops, + .pm = pm_sleep_ptr(&sti_dwmac_pm_ops), .of_match_table = sti_dwmac_match, }, }; From patchwork Sat Dec 28 23:32:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raphael Gallais-Pou X-Patchwork-Id: 13922540 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.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 5B7D319D8BC; Sat, 28 Dec 2024 23:33:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735428784; cv=none; b=mskkZmC4Th185F+DVhfP76jzoyMKfF+F4ylasBGjiI83AljcYiXDHPBQD71GdMlMJTK9Mg/gCQyJltiGFBDgtPMMemnMo+TyjTNSrPZL0UfN22Q0JdB5yfQZMGXruehsBCriyr86GQjndx5CG5BSPwDqXOnZo6tfW3Gup3yZ5mg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735428784; c=relaxed/simple; bh=2SAyWje7KVs9u2R4zoEyduMFN1gU91zxKOMAXSN9WYY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lUSNOVNHOU59BfTW+1x+3aJU3WJSBcvDbBjARYbVPHi3DKPPfgpkEKevDX/oEyIzFSqmrNnJ2vIJYNK15nCdxVRD4iGXqzi4+t+NuVAoMfNoMKDY0AnOusu1bEteUsZwJ9djqdxHFwAZnPI0hGveLMTvvjKdT6yW5x5ZAjDQfio= 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=gTmrw5kT; arc=none smtp.client-ip=209.85.128.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="gTmrw5kT" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so86680315e9.3; Sat, 28 Dec 2024 15:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735428781; x=1736033581; 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=i3zTfYTmH7V6QXuNHKkMZLGYqANdc4Kmp0yLfTvIJII=; b=gTmrw5kTT/t5wpHjKIFXGBV8YJNVtczGaBk4hnFjoIw5uVs98fPAssIZ3H5Ig94SzX OoFDXhHCjnl+n4pdOGUquYEUn/+AaB07dbCQ5hW0cZD9P7o7HWVBEv17FGlCJdlLN6zv d3/cjbPkLNZYwPjwWdGjfGRB1t3aQ2CnGyU5fRChqTkyek39tvEyii302sJV2yc54UXw iEAS2qgDx3atsr/cpUX0vJ2dmIffRk8bMrU9RUYBxLLgelmEYVnyJIf0CKZpHMomGjw9 Dei32SYqd6JGEjYY2VcRUnHbu+W9g7UxysqsliV4UdyUBDKpHIWj18eJ3MJMUjn7VL6o +Uhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735428781; x=1736033581; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i3zTfYTmH7V6QXuNHKkMZLGYqANdc4Kmp0yLfTvIJII=; b=XPXSp056xD20LNcOo2M5bIBnLobGqRladw2fkfA9Xiko+jDLOyxK4gcugi4wuAId41 V9j5f7qMUyIAo5kyUZG/59vAneAhGO6lTfYS2bTMEHYb1elaUiXWioCrSGtGWG1fY0DS /G7QOw5Qe1Qye/xeoJUoz60B1nSs1X+r1UFNV1AwEPi1aMIxNTQXyrDLsSNjM9FQGoRj WUozRoGcwA4EJbDW3taPeEhqYngAxjkQI5yywPeoRLKdrgXYO3SEytUJxerWHULiEmht ivuFs+AOO60m66me1RBd9q1o4rD02n8sF/TYhuBR6fbL0zQJ0sj8MCvSldaDfTYYoIVN 7YJA== X-Forwarded-Encrypted: i=1; AJvYcCUPNrfP8J+09VA6qna5SWYPNWp99c/whur3UpEYQzqh6fUWWqmYZ4U0cn/RPzUm+hxZv3neC19j@vger.kernel.org, AJvYcCUR3w1Ggtw3WFS9+A8cryTa+tQPDU34kgrYRj8ay7SDWvKJRe0RF/dQnZeUq8LlNe725ISeCqMLVhw=@vger.kernel.org, AJvYcCVOiWZmv6Op4UhHStOoU14ixatpCuY0Cy6sucivZ3HupYqHfql42yFiVBioGeSFqiJO+B7lG6JIxlTu@vger.kernel.org, AJvYcCVQYEXc9+kbctL58H5pLDHOCr2dzyEmiwYZagQxuFRV24JRrLAGFHTKvxXXqHmrE2auDTdybHEn79Mc@vger.kernel.org, AJvYcCW36u8vrSXciDgB0Q2237DppgSU64OEJmpPP1X7/BX47Tsxe3jN2OIK/Ku8GD8bclLaot7cV7ErArrH@vger.kernel.org, AJvYcCWy4R5+Au5NpLoCiPc+NmMICS60uMz4dNrCdQgZnkyaRSsKGYscc7BfavagxhY5JJQ6TkGLoCcg8xtB6rHK@vger.kernel.org X-Gm-Message-State: AOJu0YzXvRzrUQ7JS8TOiPxmQCZ7OFHkadn15co0qR0oxkozlBV5A9tU FeJ/jYkjZ9rJyGcnATSaqM0+HnKG5+MADT5PMKP4WOYgLeC/N8F9 X-Gm-Gg: ASbGncvzWW3mKAUxeQJFZauc/Kjsr5N3KBZJ8c4FWduNoBSQpz8ByxYX8GU5M98qb8z awM3zTNGfXYju+CQf5EUgdmoODyYx5+eqbSZmDBZIKe6WHoqALhFWEpKFelwsrYlzMFjtglBrU/ wQ1PnMll+iE3gN2S+dlmKKLEr0ragChvl5tZJCYLrckGTi0wDIectW+gdge+4VJH5tOOKwMChEi yAXBN2rAClHDY9lptufHhMocR7m1pLRGW3Dvv4JKjofxzJIHD2tLi4xxQ== X-Google-Smtp-Source: AGHT+IEcJYHmTXyjTQ0IKDccCfhouFmdjCPXPJuqVdFHdCEXf871k685aGmx4Gh0Y+WbNAty4FI1JQ== X-Received: by 2002:a05:6000:4021:b0:385:e4a7:df07 with SMTP id ffacd0b85a97d-38a223f76a3mr28191587f8f.42.1735428780424; Sat, 28 Dec 2024 15:33:00 -0800 (PST) Received: from localhost ([2a01:e0a:d9a:4c20:d6da:7147:f20e:31de]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4366127c4b0sm309653465e9.35.2024.12.28.15.32.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 15:33:00 -0800 (PST) From: Raphael Gallais-Pou Date: Sun, 29 Dec 2024 00:32:45 +0100 Subject: [PATCH 6/6] spi: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241229-update_pm_macro-v1-6-c7d4c4856336@gmail.com> References: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> In-Reply-To: <20241229-update_pm_macro-v1-0-c7d4c4856336@gmail.com> To: Patrice Chotard , Thinh Nguyen , Greg Kroah-Hartman , Adrian Hunter , Ulf Hansson , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Damien Le Moal , Niklas Cassel , Alexandre Torgue , Jose Abreu , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Mark Brown Cc: linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-ide@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-spi@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1701; i=rgallaispou@gmail.com; h=from:subject:message-id; bh=2SAyWje7KVs9u2R4zoEyduMFN1gU91zxKOMAXSN9WYY=; b=owEBbQKS/ZANAwAIAechimjUEsK1AcsmYgBncIqlgyp8ozEWbmqkXK9N4hLvauXPgVgz8iuIX xBtJUtexBuJAjMEAAEIAB0WIQQgmXv2E+fvbV/9ui/nIYpo1BLCtQUCZ3CKpQAKCRDnIYpo1BLC tQjtEACgRG4xlJ7uKeIA7lnM0soMV6YFReYT4AAeQKOEdIX+sJjm1B/RWvmEgjXHXiMS6i/olGb tdDopgx+J7oOsCT66udg8iNHBKWlKb/czzNYxNoGUk7ot5nUdnl3Bpi4D04kQrhx0LX+BMyTZ1s +tUcKBW2RH7Kjv2vjN1o/ibE7G6bNCGaBwQGTQ9bQd4lxohl9pKtpGmSYvHzpKodw074qMs+YdT z4kVd89fIMpy7xqvrsFb27UR/VRPP8IpZ02niz+kXpcXaEQaVz6Gexv+T/QlM37+ep/oXUYpFEz wl2lxWo3Dr87Xr1tl8nkk9R+1KGlQXOCm+jQOBA5Glz7qtPq9KyckYmCnaioNMg4QZ1dJKjgN8E BP0o+AKr2SsiZrlB0eG59j0BtjMzxcHcTjtCqqc9eLfL3QxRkjDnRXslWdHYjK3xarvL4qoWFnc 5SoEnxWQAzlBUlnMQbMz+rvUOBgBf2CkbJL00q/21GlSPaafulA5Ir3UE8ZutbThESAmOb3YCCC 7KICCYh5ru3stSIk3v57JjCGG8OmoViMTw9TdUI1I57+KNmiSlNoC84LUAqRsXLEl2kHrXrPH46 0b5vWiZUeMOn33qDrFPEiGuHlzP3BcA0M7IwZNPW7nJ1rhQ6H9dkT9dR3nF1MtJg2X2Orpw5FsW Ww6pQALy6v0aVTA== X-Developer-Key: i=rgallaispou@gmail.com; a=openpgp; fpr=20997BF613E7EF6D5FFDBA2FE7218A68D412C2B5 Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards. Link: https://lore.kernel.org/all/20240716180010.126987-1-rgallaispou@gmail.com Signed-off-by: Raphael Gallais-Pou --- drivers/spi/spi-st-ssc4.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c index 4cff976ab16fbdf3708ab870176a04f2628b501b..5cc452447410bedf3c12893d94bc959892ac827d 100644 --- a/drivers/spi/spi-st-ssc4.c +++ b/drivers/spi/spi-st-ssc4.c @@ -378,7 +378,6 @@ static void spi_st_remove(struct platform_device *pdev) pinctrl_pm_select_sleep_state(&pdev->dev); } -#ifdef CONFIG_PM static int spi_st_runtime_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -403,9 +402,7 @@ static int spi_st_runtime_resume(struct device *dev) return ret; } -#endif -#ifdef CONFIG_PM_SLEEP static int spi_st_suspend(struct device *dev) { struct spi_controller *host = dev_get_drvdata(dev); @@ -429,7 +426,6 @@ static int spi_st_resume(struct device *dev) return pm_runtime_force_resume(dev); } -#endif static const struct dev_pm_ops spi_st_pm = { SET_SYSTEM_SLEEP_PM_OPS(spi_st_suspend, spi_st_resume) @@ -445,7 +441,7 @@ MODULE_DEVICE_TABLE(of, stm_spi_match); static struct platform_driver spi_st_driver = { .driver = { .name = "spi-st", - .pm = &spi_st_pm, + .pm = pm_sleep_ptr(&spi_st_pm), .of_match_table = of_match_ptr(stm_spi_match), }, .probe = spi_st_probe,