Skip to content

Commit c542ce1

Browse files
committed

File tree

drivers/net/pcs/pcs-mtk-lynxi.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,9 +465,12 @@ static int mtk_pcs_lynxi_probe(struct platform_device *pdev)
465465
if (IS_ERR(mpcs->sgmii_tx))
466466
return PTR_ERR(mpcs->sgmii_tx);
467467

468-
mpcs->xfi_tphy = devm_of_phy_get(mpcs->dev, np, NULL);
469-
if (IS_ERR(mpcs->xfi_tphy))
470-
return PTR_ERR(mpcs->xfi_tphy);
468+
if (of_parse_phandle(dev->of_node, "phys", 0)) {
469+
mpcs->xfi_tphy = devm_of_phy_get(mpcs->dev, dev->of_node, NULL);
470+
if (IS_ERR(mpcs->xfi_tphy))
471+
return PTR_ERR(mpcs->xfi_tphy);
472+
} else
473+
mpcs->xfi_tphy = NULL;
471474

472475
pcs = mtk_pcs_lynxi_init(dev, regmap, (uintptr_t)of_device_get_match_data(dev),
473476
flags, mpcs);

0 commit comments

Comments
 (0)