[PATCH net-next 10/12] net: pse-pd: Register regulator even for undescribed PSE PIs

Kory Maincent posted 12 patches 1 year, 4 months ago
There is a newer version of this series
[PATCH net-next 10/12] net: pse-pd: Register regulator even for undescribed PSE PIs
Posted by Kory Maincent 1 year, 4 months ago
From: Kory Maincent (Dent Project) <kory.maincent@bootlin.com>

Ensure that regulators are registered for all PSE PIs, even those not
explicitly described in the device tree. This change lays the
groundwork for future support of regulator notifiers. Maintaining
consistent ordering between the PSE PIs regulator table and the
regulator notifier table will prevent added complexity in future
implementations.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---
 drivers/net/pse-pd/pse_core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/pse-pd/pse_core.c b/drivers/net/pse-pd/pse_core.c
index 6b3893a3381c..d365fb7c8a98 100644
--- a/drivers/net/pse-pd/pse_core.c
+++ b/drivers/net/pse-pd/pse_core.c
@@ -463,10 +463,6 @@ int pse_controller_register(struct pse_controller_dev *pcdev)
 	for (i = 0; i < pcdev->nr_lines; i++) {
 		char *reg_name;
 
-		/* Do not register regulator for PIs not described */
-		if (!pcdev->no_of_pse_pi && !pcdev->pi[i].np)
-			continue;
-
 		reg_name = devm_kzalloc(pcdev->dev, reg_name_len, GFP_KERNEL);
 		if (!reg_name)
 			return -ENOMEM;

-- 
2.34.1
Re: [PATCH net-next 10/12] net: pse-pd: Register regulator even for undescribed PSE PIs
Posted by Andrew Lunn 1 year, 4 months ago
On Wed, Oct 02, 2024 at 06:28:06PM +0200, Kory Maincent wrote:
> From: Kory Maincent (Dent Project) <kory.maincent@bootlin.com>
> 
> Ensure that regulators are registered for all PSE PIs, even those not
> explicitly described in the device tree. This change lays the
> groundwork for future support of regulator notifiers. Maintaining
> consistent ordering between the PSE PIs regulator table and the
> regulator notifier table will prevent added complexity in future
> implementations.

Does this change anything visible to the user?

Is it guaranteed that these unused regulators are disabled?  Not that
they were before i guess. But now they exist, should we disable them?

	Andrew
Re: [PATCH net-next 10/12] net: pse-pd: Register regulator even for undescribed PSE PIs
Posted by Kory Maincent 1 year, 4 months ago
Hello Andrew,

Thanks for your review!

On Thu, 3 Oct 2024 01:46:22 +0200
Andrew Lunn <andrew@lunn.ch> wrote:

> On Wed, Oct 02, 2024 at 06:28:06PM +0200, Kory Maincent wrote:
> > From: Kory Maincent (Dent Project) <kory.maincent@bootlin.com>
> > 
> > Ensure that regulators are registered for all PSE PIs, even those not
> > explicitly described in the device tree. This change lays the
> > groundwork for future support of regulator notifiers. Maintaining
> > consistent ordering between the PSE PIs regulator table and the
> > regulator notifier table will prevent added complexity in future
> > implementations.  
> 
> Does this change anything visible to the user?

No it doesn't.
 
> Is it guaranteed that these unused regulators are disabled?  Not that
> they were before i guess. But now they exist, should we disable them?

Indeed we could disable PI not described in the devicetree.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com