Skip to content

Commit

Permalink
phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional()
Browse files Browse the repository at this point in the history
Use devm_clk_get_optional() to get optional clock

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
  • Loading branch information
Chunfeng Yun authored and Kishon Vijay Abraham I committed Apr 17, 2019
1 parent 549b6b5 commit b603c50
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/phy/mediatek/phy-mtk-tphy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1103,13 +1103,9 @@ static int mtk_tphy_probe(struct platform_device *pdev)
}

/* it's deprecated, make it optional for backward compatibility */
tphy->u3phya_ref = devm_clk_get(dev, "u3phya_ref");
if (IS_ERR(tphy->u3phya_ref)) {
if (PTR_ERR(tphy->u3phya_ref) == -EPROBE_DEFER)
return -EPROBE_DEFER;

tphy->u3phya_ref = NULL;
}
tphy->u3phya_ref = devm_clk_get_optional(dev, "u3phya_ref");
if (IS_ERR(tphy->u3phya_ref))
return PTR_ERR(tphy->u3phya_ref);

tphy->src_ref_clk = U3P_REF_CLK;
tphy->src_coef = U3P_SLEW_RATE_COEF;
Expand Down

0 comments on commit b603c50

Please sign in to comment.