[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YXLNLWNKkcYodqCG@sirena.org.uk>
Date: Fri, 22 Oct 2021 15:39:41 +0100
From: Mark Brown <broonie@...nel.org>
To: Jim Quinlan <jim2101024@...il.com>
Cc: linux-pci@...r.kernel.org,
Nicolas Saenz Julienne <nsaenz@...nel.org>,
Rob Herring <robh@...nel.org>,
bcm-kernel-feedback-list@...adcom.com, james.quinlan@...adcom.com,
Florian Fainelli <f.fainelli@...il.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Krzysztof WilczyĆski <kw@...ux.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-rpi-kernel@...ts.infradead.org>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5 5/6] PCI: brcmstb: Do not turn off regulators if EP
can wake up
On Fri, Oct 22, 2021 at 10:06:58AM -0400, Jim Quinlan wrote:
> +enum {
> + TURN_OFF, /* Turn regulators off, unless an EP is wakeup-capable */
> + TURN_OFF_ALWAYS, /* Turn regulators off, no exceptions */
> + TURN_ON, /* Turn regulators on, unless pcie->ep_wakeup_capable */
> +};
> +
> +static int brcm_set_regulators(struct brcm_pcie *pcie, int how)
> +{
> + struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie);
I can't help but think this would be easier to follow as multiple
functions, there is very little code sharing between the different
paths especially the on and off paths.
> if (pcie->num_supplies) {
> - (void)brcm_set_regulators(pcie, false);
> + (void)brcm_set_regulators(pcie, TURN_OFF_ALWAYS);
I should've mentioned this on the earlier path but it's not normal Linux
style to cast return values to void and looks worrying.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists