OSDN Git Service

PCI: cadence: Correct probe behaviour when failing to get PHY
authorAlan Douglas <adouglas@cadence.com>
Fri, 28 Sep 2018 10:51:18 +0000 (11:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:08:35 +0000 (11:08 -0800)
commitf7087a371d7106b77612aeebb354ceeff8ec77ec
treeb3357aa26128975e058c9ee69d0e788cbc37f69d
parent6596e997745c4b434b688e9d4c6f737648efd981
PCI: cadence: Correct probe behaviour when failing to get PHY

[ Upstream commit aa77e55d48124d0d78456eabf872fffb5decdbe1 ]

Test the correct value to see whether the PHY get failed.

Use devm_phy_get() instead of devm_phy_optional_get(), since it is
only called if phy name is given in devicetree and so should exist.
If failure when getting or linking PHY, put any PHYs which were
already got and unlink them.

Fixes: dfb80534692ddc5b ("PCI: cadence: Add generic PHY support to host and EP drivers")
Reported-by: Colin King <colin.king@canonical.com>
Signed-off-by: Alan Douglas <adouglas@cadence.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/controller/pcie-cadence.c