PCI: tegra: Convert to devm_of_phy_optional_get()

Use the new devm_of_phy_optional_get() helper instead of open-coding the
same operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/56508eeadf7fa8692877e872871f10294d48c49d.1674584626.git.geert+renesas@glider.be
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
Geert Uytterhoeven 2023-01-24 19:37:26 +01:00 коммит произвёл Vinod Koul
Родитель 9da87c6ef7
Коммит a80becc56d
1 изменённых файлов: 1 добавлений и 4 удалений

Просмотреть файл

@ -1330,12 +1330,9 @@ static struct phy *devm_of_phy_optional_get_index(struct device *dev,
if (!name)
return ERR_PTR(-ENOMEM);
phy = devm_of_phy_get(dev, np, name);
phy = devm_of_phy_optional_get(dev, np, name);
kfree(name);
if (PTR_ERR(phy) == -ENODEV)
phy = NULL;
return phy;
}