Message ID | 1508242263-73684-1-git-send-email-weiyongjun1@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
On Tue, Oct 17, 2017 at 2:11 PM, Wei Yongjun <weiyongjun1@huawei.com> wrote: > PTR_ERR should access the value just tested by IS_ERR, otherwise > the wrong error code will be returned. > > Fixes: 2eeb02b28579 ("PCI: faraday: Add clock handling") > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Whoops, thanks! Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
On Tue, Oct 17, 2017 at 12:11:03PM +0000, Wei Yongjun wrote: > PTR_ERR should access the value just tested by IS_ERR, otherwise > the wrong error code will be returned. > > Fixes: 2eeb02b28579 ("PCI: faraday: Add clock handling") > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Applied with Linus' reviewed-by to pci/host-faraday for v4.15, thanks! > --- > drivers/pci/host/pci-ftpci100.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/host/pci-ftpci100.c b/drivers/pci/host/pci-ftpci100.c > index 06d9687..fae6bd1 100644 > --- a/drivers/pci/host/pci-ftpci100.c > +++ b/drivers/pci/host/pci-ftpci100.c > @@ -463,7 +463,7 @@ static int faraday_pci_probe(struct platform_device *pdev) > } > p->bus_clk = devm_clk_get(dev, "PCICLK"); > if (IS_ERR(p->bus_clk)) > - return PTR_ERR(clk); > + return PTR_ERR(p->bus_clk); > ret = clk_prepare_enable(p->bus_clk); > if (ret) { > dev_err(dev, "could not prepare PCICLK\n"); >
diff --git a/drivers/pci/host/pci-ftpci100.c b/drivers/pci/host/pci-ftpci100.c index 06d9687..fae6bd1 100644 --- a/drivers/pci/host/pci-ftpci100.c +++ b/drivers/pci/host/pci-ftpci100.c @@ -463,7 +463,7 @@ static int faraday_pci_probe(struct platform_device *pdev) } p->bus_clk = devm_clk_get(dev, "PCICLK"); if (IS_ERR(p->bus_clk)) - return PTR_ERR(clk); + return PTR_ERR(p->bus_clk); ret = clk_prepare_enable(p->bus_clk); if (ret) { dev_err(dev, "could not prepare PCICLK\n");
PTR_ERR should access the value just tested by IS_ERR, otherwise the wrong error code will be returned. Fixes: 2eeb02b28579 ("PCI: faraday: Add clock handling") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> --- drivers/pci/host/pci-ftpci100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)