Skip to content

Commit 2d8c509

Browse files
wensbjorn-helgaas
authored andcommitted
PCI/pwrctrl: Do not power off on pwrctrl device removal
With the move to explicit pwrctrl power on/off APIs, the caller, i.e., the PCI controller driver, should manage the power state. The pwrctrl drivers should not try to clean up or power off when they are removed, as this might end up disabling an already disabled regulator, causing a big warning. This can be triggered if a PCI controller driver's .remove() callback calls pci_pwrctrl_destroy_devices() after pci_pwrctrl_power_off_devices(). Drop the devm cleanup parts that turn off regulators from the pwrctrl drivers. Fixes: b921aa3 ("PCI/pwrctrl: Switch to pwrctrl create, power on/off, destroy APIs") Signed-off-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent c369299 commit 2d8c509

2 files changed

Lines changed: 0 additions & 13 deletions

File tree

drivers/pci/pwrctrl/pci-pwrctrl-pwrseq.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,6 @@ static int pwrseq_pwrctrl_power_off(struct pci_pwrctrl *pwrctrl)
6868
return pwrseq_power_off(pwrseq->pwrseq);
6969
}
7070

71-
static void devm_pwrseq_pwrctrl_power_off(void *data)
72-
{
73-
struct pwrseq_pwrctrl *pwrseq = data;
74-
75-
pwrseq_pwrctrl_power_off(&pwrseq->pwrctrl);
76-
}
77-
7871
static int pwrseq_pwrctrl_probe(struct platform_device *pdev)
7972
{
8073
const struct pwrseq_pwrctrl_pdata *pdata;
@@ -101,11 +94,6 @@ static int pwrseq_pwrctrl_probe(struct platform_device *pdev)
10194
return dev_err_probe(dev, PTR_ERR(pwrseq->pwrseq),
10295
"Failed to get the power sequencer\n");
10396

104-
ret = devm_add_action_or_reset(dev, devm_pwrseq_pwrctrl_power_off,
105-
pwrseq);
106-
if (ret)
107-
return ret;
108-
10997
pwrseq->pwrctrl.power_on = pwrseq_pwrctrl_power_on;
11098
pwrseq->pwrctrl.power_off = pwrseq_pwrctrl_power_off;
11199

drivers/pci/pwrctrl/slot.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ static void devm_slot_pwrctrl_release(void *data)
6363
{
6464
struct slot_pwrctrl *slot = data;
6565

66-
slot_pwrctrl_power_off(&slot->pwrctrl);
6766
regulator_bulk_free(slot->num_supplies, slot->supplies);
6867
}
6968

0 commit comments

Comments
 (0)