Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.18.y 1/2] PCI/pwrctrl: slot: Rename private struct and pointers for consistency
Date: Wed, 11 Nov 2026 17:00:30 -0500	[thread overview]
Message-ID: <20261111220022.4081244-1-sashal@kernel.org> (raw)
In-Reply-To: <20261107051332-failed-6.18-ee450e3a2d33@kernel.org>

From: Bjorn Helgaas <bhelgaas@google.com>

[ Upstream commit e40d16e6c23994b28894179b87f9747edd63062a ]

Previously the pwrseq, tc9563, and slot pwrctrl drivers used different
naming conventions for their private data structs and pointers to them,
which makes patches hard to read.

Rename structs, variables, and functions to reduce boiler-plate and start
with "slot":

  struct pci_pwrctrl_slot_data      -> struct slot_pwrctrl
  struct pci_pwrctrl ctx            -> struct pci_pwrctrl pwrctrl
  pci_pwrctrl_slot_probe()          -> slot_pwrctrl_probe()
  pci_pwrctrl_slot_of_match[]       -> slot_pwrctrl_of_match[]
  pci_pwrctrl_slot_driver           -> slot_pwrctrl_driver
  devm_pci_pwrctrl_slot_power_off() -> devm_slot_pwrctrl_power_off()

No functional change intended.

[bhelgaas: move "slot" to beginning, also rename functions, etc]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260115-pci-pwrctrl-rework-v5-2-9d26da3ce903@oss.qualcomm.com
Stable-dep-of: ee450e3a2d33 ("PCI/pwrctrl: generic: Fix leaking array from of_regulator_bulk_get_all()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/pci/pwrctrl/slot.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/pci/pwrctrl/slot.c b/drivers/pci/pwrctrl/slot.c
index 3320494b62d89..51de1eecdb26b 100644
--- a/drivers/pci/pwrctrl/slot.c
+++ b/drivers/pci/pwrctrl/slot.c
@@ -13,23 +13,23 @@
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 
-struct pci_pwrctrl_slot_data {
-	struct pci_pwrctrl ctx;
+struct slot_pwrctrl {
+	struct pci_pwrctrl pwrctrl;
 	struct regulator_bulk_data *supplies;
 	int num_supplies;
 };
 
-static void devm_pci_pwrctrl_slot_power_off(void *data)
+static void devm_slot_pwrctrl_power_off(void *data)
 {
-	struct pci_pwrctrl_slot_data *slot = data;
+	struct slot_pwrctrl *slot = data;
 
 	regulator_bulk_disable(slot->num_supplies, slot->supplies);
 	regulator_bulk_free(slot->num_supplies, slot->supplies);
 }
 
-static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
+static int slot_pwrctrl_probe(struct platform_device *pdev)
 {
-	struct pci_pwrctrl_slot_data *slot;
+	struct slot_pwrctrl *slot;
 	struct device *dev = &pdev->dev;
 	struct clk *clk;
 	int ret;
@@ -53,7 +53,7 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = devm_add_action_or_reset(dev, devm_pci_pwrctrl_slot_power_off,
+	ret = devm_add_action_or_reset(dev, devm_slot_pwrctrl_power_off,
 				       slot);
 	if (ret)
 		return ret;
@@ -64,31 +64,31 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
 				     "Failed to enable slot clock\n");
 	}
 
-	pci_pwrctrl_init(&slot->ctx, dev);
+	pci_pwrctrl_init(&slot->pwrctrl, dev);
 
-	ret = devm_pci_pwrctrl_device_set_ready(dev, &slot->ctx);
+	ret = devm_pci_pwrctrl_device_set_ready(dev, &slot->pwrctrl);
 	if (ret)
 		return dev_err_probe(dev, ret, "Failed to register pwrctrl driver\n");
 
 	return 0;
 }
 
-static const struct of_device_id pci_pwrctrl_slot_of_match[] = {
+static const struct of_device_id slot_pwrctrl_of_match[] = {
 	{
 		.compatible = "pciclass,0604",
 	},
 	{ }
 };
-MODULE_DEVICE_TABLE(of, pci_pwrctrl_slot_of_match);
+MODULE_DEVICE_TABLE(of, slot_pwrctrl_of_match);
 
-static struct platform_driver pci_pwrctrl_slot_driver = {
+static struct platform_driver slot_pwrctrl_driver = {
 	.driver = {
 		.name = "pci-pwrctrl-slot",
-		.of_match_table = pci_pwrctrl_slot_of_match,
+		.of_match_table = slot_pwrctrl_of_match,
 	},
-	.probe = pci_pwrctrl_slot_probe,
+	.probe = slot_pwrctrl_probe,
 };
-module_platform_driver(pci_pwrctrl_slot_driver);
+module_platform_driver(slot_pwrctrl_driver);
 
 MODULE_AUTHOR("Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>");
 MODULE_DESCRIPTION("Generic PCI Power Control driver for PCI Slots");
-- 
2.53.0


  reply	other threads:[~2026-11-11 22:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 10:13 FAILED: patch "[PATCH] PCI/pwrctrl: generic: Fix leaking array from of_regulator_bulk_get_all()" failed to apply to 6.18-stable tree Sasha Levin
2026-11-11 22:00 ` Sasha Levin [this message]
2026-11-11 22:00   ` [PATCH 6.18.y 2/2] PCI/pwrctrl: generic: Fix leaking array from of_regulator_bulk_get_all() Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261111220022.4081244-1-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=bhelgaas@google.com \
    --cc=manivannan.sadhasivam@oss.qualcomm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox