Skip to content

Commit b603c50

Browse files
Chunfeng Yunkishon
authored andcommitted
phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional()
Use devm_clk_get_optional() to get optional clock Signed-off-by: Chunfeng Yun <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
1 parent 549b6b5 commit b603c50

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/phy/mediatek/phy-mtk-tphy.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,13 +1103,9 @@ static int mtk_tphy_probe(struct platform_device *pdev)
11031103
}
11041104

11051105
/* it's deprecated, make it optional for backward compatibility */
1106-
tphy->u3phya_ref = devm_clk_get(dev, "u3phya_ref");
1107-
if (IS_ERR(tphy->u3phya_ref)) {
1108-
if (PTR_ERR(tphy->u3phya_ref) == -EPROBE_DEFER)
1109-
return -EPROBE_DEFER;
1110-
1111-
tphy->u3phya_ref = NULL;
1112-
}
1106+
tphy->u3phya_ref = devm_clk_get_optional(dev, "u3phya_ref");
1107+
if (IS_ERR(tphy->u3phya_ref))
1108+
return PTR_ERR(tphy->u3phya_ref);
11131109

11141110
tphy->src_ref_clk = U3P_REF_CLK;
11151111
tphy->src_coef = U3P_SLEW_RATE_COEF;

0 commit comments

Comments
 (0)