]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: mediatek-gen3: Fix incorrectly skipped pwrctrl error message
authorChen-Yu Tsai <wenst@chromium.org>
Tue, 12 May 2026 10:33:45 +0000 (18:33 +0800)
committerManivannan Sadhasivam <mani@kernel.org>
Tue, 19 May 2026 14:26:41 +0000 (19:56 +0530)
When pwrctrl integration was added, the error message for
pci_pwrctrl_create_devices() failure was incorrectly added after the goto
statement, causing it to be skipped.

Move the goto statement after the dev_err_probe() call so that the
error message actually gets printed (or saved if probe is deferred).

Fixes: 1a152e21940a ("PCI: mediatek-gen3: Integrate new pwrctrl API")
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/all/adjNaKB5KGpl6qIp@stanley.mountain/
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Hans Zhang <18255117159@163.com>
Link: https://patch.msgid.link/20260512103347.1751080-1-wenst@chromium.org
drivers/pci/controller/pcie-mediatek-gen3.c

index 1da2166d1017744e48547bd1beec1cf6d76febfe..654e63f8fb57f2a2dc89bb4767f431cf0f224dc6 100644 (file)
@@ -1242,8 +1242,8 @@ static int mtk_pcie_probe(struct platform_device *pdev)
 
        err = pci_pwrctrl_create_devices(pcie->dev);
        if (err) {
-               goto err_tear_down_irq;
                dev_err_probe(dev, err, "failed to create pwrctrl devices\n");
+               goto err_tear_down_irq;
        }
 
        err = mtk_pcie_setup(pcie);