From patchwork Wed Apr 10 06:13:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 10893197 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE650922 for ; Wed, 10 Apr 2019 06:13:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8B4A2889C for ; Wed, 10 Apr 2019 06:13:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C933289E5; Wed, 10 Apr 2019 06:13:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9014E2889C for ; Wed, 10 Apr 2019 06:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726909AbfDJGN1 (ORCPT ); Wed, 10 Apr 2019 02:13:27 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:13794 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726661AbfDJGN1 (ORCPT ); Wed, 10 Apr 2019 02:13:27 -0400 X-UUID: c6f1cf9406454bf8933101b90968ea70-20190410 X-UUID: c6f1cf9406454bf8933101b90968ea70-20190410 Received: from mtkcas34.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 325427869; Wed, 10 Apr 2019 14:13:10 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 10 Apr 2019 14:13:09 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 10 Apr 2019 14:13:08 +0800 From: Chunfeng Yun To: Kishon Vijay Abraham I CC: Kevin Hilman , Chunfeng Yun , Matthias Brugger , Andy Gross , David Brown , Masahiro Yamada , Martin Blumenstingl , Grygorii Strashko , Kunihiko Hayashi , Masami Hiramatsu , Motoya Tanigawa , , , , , Subject: [v2 PATCH 1/4] phy: phy-mtk-tphy: get optional clock by devm_clk_get_optional() Date: Wed, 10 Apr 2019 14:13:03 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_clk_get_optional() to get optional clock Signed-off-by: Chunfeng Yun --- v2: no changes --- drivers/phy/mediatek/phy-mtk-tphy.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index 5b6a470ca145..cb2ed3b25068 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -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;