* [PATCH] PCI: cadence: check the correct variable
@ 2018-09-19 10:34 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2018-09-19 10:34 UTC (permalink / raw)
To: Alan Douglas; +Cc: Lorenzo Pieralisi, Bjorn Helgaas, linux-pci, kernel-janitors
We should be checking "phy[i]" instead of "phy".
Fixes: dfb80534692d ("PCI: cadence: Add generic PHY support to host and EP drivers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/pci/controller/pcie-cadence.c b/drivers/pci/controller/pcie-cadence.c
index 86f1b002c846..5e369dd183c8 100644
--- a/drivers/pci/controller/pcie-cadence.c
+++ b/drivers/pci/controller/pcie-cadence.c
@@ -191,8 +191,8 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie)
for (i = 0; i < phy_count; i++) {
of_property_read_string_index(np, "phy-names", i, &name);
phy[i] = devm_phy_optional_get(dev, name);
- if (IS_ERR(phy))
- return PTR_ERR(phy);
+ if (IS_ERR(phy[i]))
+ return PTR_ERR(phy[i]);
link[i] = device_link_add(dev, &phy[i]->dev, DL_FLAG_STATELESS);
if (!link[i]) {
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] PCI: cadence: check the correct variable
@ 2018-09-19 10:34 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2018-09-19 10:34 UTC (permalink / raw)
To: Alan Douglas; +Cc: Lorenzo Pieralisi, Bjorn Helgaas, linux-pci, kernel-janitors
We should be checking "phy[i]" instead of "phy".
Fixes: dfb80534692d ("PCI: cadence: Add generic PHY support to host and EP drivers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/pci/controller/pcie-cadence.c b/drivers/pci/controller/pcie-cadence.c
index 86f1b002c846..5e369dd183c8 100644
--- a/drivers/pci/controller/pcie-cadence.c
+++ b/drivers/pci/controller/pcie-cadence.c
@@ -191,8 +191,8 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie)
for (i = 0; i < phy_count; i++) {
of_property_read_string_index(np, "phy-names", i, &name);
phy[i] = devm_phy_optional_get(dev, name);
- if (IS_ERR(phy))
- return PTR_ERR(phy);
+ if (IS_ERR(phy[i]))
+ return PTR_ERR(phy[i]);
link[i] = device_link_add(dev, &phy[i]->dev, DL_FLAG_STATELESS);
if (!link[i]) {
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI: cadence: check the correct variable
2018-09-19 10:34 ` Dan Carpenter
@ 2018-09-19 10:42 ` Lorenzo Pieralisi
-1 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Pieralisi @ 2018-09-19 10:42 UTC (permalink / raw)
To: Dan Carpenter, Alan Douglas; +Cc: Bjorn Helgaas, linux-pci, kernel-janitors
On Wed, Sep 19, 2018 at 01:34:11PM +0300, Dan Carpenter wrote:
> We should be checking "phy[i]" instead of "phy".
>
> Fixes: dfb80534692d ("PCI: cadence: Add generic PHY support to host and EP drivers")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/pci/controller/pcie-cadence.c b/drivers/pci/controller/pcie-cadence.c
> index 86f1b002c846..5e369dd183c8 100644
> --- a/drivers/pci/controller/pcie-cadence.c
> +++ b/drivers/pci/controller/pcie-cadence.c
> @@ -191,8 +191,8 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie)
> for (i = 0; i < phy_count; i++) {
> of_property_read_string_index(np, "phy-names", i, &name);
> phy[i] = devm_phy_optional_get(dev, name);
> - if (IS_ERR(phy))
> - return PTR_ERR(phy);
> + if (IS_ERR(phy[i]))
> + return PTR_ERR(phy[i]);
>
> link[i] = device_link_add(dev, &phy[i]->dev, DL_FLAG_STATELESS);
> if (!link[i]) {
Alan,
technically, patch (that I already queued):
https://patchwork.ozlabs.org/patch/966547/
fixes this issue; in theory we should split it in two patches to
first do what this patch does and then update the _get() API but I
think it is overkill. Do you want me to squash this patch log into
the patch above log for completeness ?
Thanks,
Lorenzo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI: cadence: check the correct variable
@ 2018-09-19 10:42 ` Lorenzo Pieralisi
0 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Pieralisi @ 2018-09-19 10:42 UTC (permalink / raw)
To: Dan Carpenter, Alan Douglas; +Cc: Bjorn Helgaas, linux-pci, kernel-janitors
On Wed, Sep 19, 2018 at 01:34:11PM +0300, Dan Carpenter wrote:
> We should be checking "phy[i]" instead of "phy".
>
> Fixes: dfb80534692d ("PCI: cadence: Add generic PHY support to host and EP drivers")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/pci/controller/pcie-cadence.c b/drivers/pci/controller/pcie-cadence.c
> index 86f1b002c846..5e369dd183c8 100644
> --- a/drivers/pci/controller/pcie-cadence.c
> +++ b/drivers/pci/controller/pcie-cadence.c
> @@ -191,8 +191,8 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie)
> for (i = 0; i < phy_count; i++) {
> of_property_read_string_index(np, "phy-names", i, &name);
> phy[i] = devm_phy_optional_get(dev, name);
> - if (IS_ERR(phy))
> - return PTR_ERR(phy);
> + if (IS_ERR(phy[i]))
> + return PTR_ERR(phy[i]);
>
> link[i] = device_link_add(dev, &phy[i]->dev, DL_FLAG_STATELESS);
> if (!link[i]) {
Alan,
technically, patch (that I already queued):
https://patchwork.ozlabs.org/patch/966547/
fixes this issue; in theory we should split it in two patches to
first do what this patch does and then update the _get() API but I
think it is overkill. Do you want me to squash this patch log into
the patch above log for completeness ?
Thanks,
Lorenzo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI: cadence: check the correct variable
2018-09-19 10:42 ` Lorenzo Pieralisi
@ 2018-09-19 10:51 ` Dan Carpenter
-1 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2018-09-19 10:51 UTC (permalink / raw)
To: Lorenzo Pieralisi; +Cc: Alan Douglas, Bjorn Helgaas, linux-pci, kernel-janitors
Nah... Your patch is fine.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PCI: cadence: check the correct variable
@ 2018-09-19 10:51 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2018-09-19 10:51 UTC (permalink / raw)
To: Lorenzo Pieralisi; +Cc: Alan Douglas, Bjorn Helgaas, linux-pci, kernel-janitors
Nah... Your patch is fine.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-09-19 16:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-19 10:34 [PATCH] PCI: cadence: check the correct variable Dan Carpenter
2018-09-19 10:34 ` Dan Carpenter
2018-09-19 10:42 ` Lorenzo Pieralisi
2018-09-19 10:42 ` Lorenzo Pieralisi
2018-09-19 10:51 ` Dan Carpenter
2018-09-19 10:51 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.