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: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10893195 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 8865F922 for ; Wed, 10 Apr 2019 06:13:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68FFA2889C for ; Wed, 10 Apr 2019 06:13:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C94C289ED; Wed, 10 Apr 2019 06:13:28 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B0C772889C for ; Wed, 10 Apr 2019 06:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pxMmQ77x5v/REAFtVQDSiH8BFTt49RGPySG3TzG3kOs=; b=JV0IqBY01yZMF6 UQERDsctDmqP6e1ZTOfhO85SPqYABo60CReqmF/0RCB9A56dQ7UxguAqiMgykxLiQ0UXiSsJpuQYb Q7eb1G4UvT2SsNOMSWZkimgE4xAGVWTvfbNkRTix9y92DJUjqyMjQ4hj3YcNtiDRV17hPEOa/AOEz lsYCScNyFI9gtjlohsSQf47hc53XVPKiGSCaBbf3rqH+9YXsphACaE60MQNe3oFt1TLdc8Og1khuv p1IgVHRWW6fKoLxtOM7FxnaaXIJOrf+nsRTgYLL12I6HhBHGycjnJbgcDpahTIfDNYyA5bjDO9YXc 97T9+86os7MvK/wewMsg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE6UB-0008OF-Bk; Wed, 10 Apr 2019 06:13:27 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE6U7-0008N4-F5; Wed, 10 Apr 2019 06:13:25 +0000 X-UUID: d37b50e646024a4bba68dc39ec2399c2-20190409 X-UUID: d37b50e646024a4bba68dc39ec2399c2-20190409 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1273169556; Tue, 09 Apr 2019 22:13:13 -0800 Received: from MTKMBS31N1.mediatek.inc (172.27.4.69) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 9 Apr 2019 23:13:12 -0700 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190409_231323_507356_97DFD774 X-CRM114-Status: GOOD ( 10.13 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Brown , Grygorii Strashko , Masami Hiramatsu , Kunihiko Hayashi , Masahiro Yamada , Martin Blumenstingl , Kevin Hilman , Motoya Tanigawa , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Andy Gross , Matthias Brugger , linux-arm-msm@vger.kernel.org, Chunfeng Yun , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.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; From patchwork Wed Apr 10 06:13:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10893223 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 4AB5A1390 for ; Wed, 10 Apr 2019 06:14:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B7A7289E5 for ; Wed, 10 Apr 2019 06:14:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B113289E9; Wed, 10 Apr 2019 06:14:32 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDC0B289E5 for ; Wed, 10 Apr 2019 06:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SqhjFnjN5JB5jr9sC8LHirPOYqK/LPcejhIGzNC8JsY=; b=AdlVIjvcdNDHtm i5cNVw7Vi+AMbG7FzFCRKaKq4RgQM6AaT1Xovj9U+LVcevGyXkAKtE8k1/KEwAceA1Ox4MF2ps5Km +len+QnhYcriNvtjk0tsgDD84eZYJx4EziPQcS91ZuUQ5ut61UiSio3W+eRHdWFu60xacW3/5vdDw +tXu1Hho5mX+poQvUUyp797JfSMUktkc4hJ+gSVKi6YWAboomduLRYzQqRslBzQTg/p718ZANcMSG J4wsNpfUFqyq8+03ZZUGzKF8CyYqXz3tJHZD3B2d72pXf47BoZrk4TMt3Ttb7a9/+hKWIJTHt+IK7 k18pcC5572FPkuGA2OzA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE6VC-0001KY-Bb; Wed, 10 Apr 2019 06:14:30 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE6Uw-00010C-5a; Wed, 10 Apr 2019 06:14:16 +0000 X-UUID: baf4497acbd7469c9f8e4d659868c801-20190409 X-UUID: baf4497acbd7469c9f8e4d659868c801-20190409 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 882636484; Tue, 09 Apr 2019 22:13:15 -0800 Received: from MTKMBS31DR.mediatek.inc (172.27.6.102) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 9 Apr 2019 23:13:14 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 10 Apr 2019 14:13:10 +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:09 +0800 From: Chunfeng Yun To: Kishon Vijay Abraham I Subject: [v2 PATCH 2/4] phy: qcom-qusb2: get optional clock by devm_clk_get_optional() Date: Wed, 10 Apr 2019 14:13:04 +0800 Message-ID: <50f5c2410bb86691329e5cb4d7ec38d1811fff33.1554874961.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190409_231414_210304_38F23D85 X-CRM114-Status: GOOD ( 10.96 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Brown , Grygorii Strashko , Masami Hiramatsu , Kunihiko Hayashi , Masahiro Yamada , Martin Blumenstingl , Kevin Hilman , Motoya Tanigawa , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Andy Gross , Matthias Brugger , Vivek Gautam , linux-arm-msm@vger.kernel.org, Chunfeng Yun , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_clk_get_optional() to get optional clock Cc: Andy Gross Cc: David Brown Cc: Vivek Gautam Signed-off-by: Chunfeng Yun --- v2: no changes --- drivers/phy/qualcomm/phy-qcom-qusb2.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qusb2.c b/drivers/phy/qualcomm/phy-qcom-qusb2.c index 8fd7ce139772..1cbf1d6f28ce 100644 --- a/drivers/phy/qualcomm/phy-qcom-qusb2.c +++ b/drivers/phy/qualcomm/phy-qcom-qusb2.c @@ -822,14 +822,9 @@ static int qusb2_phy_probe(struct platform_device *pdev) return ret; } - qphy->iface_clk = devm_clk_get(dev, "iface"); - if (IS_ERR(qphy->iface_clk)) { - ret = PTR_ERR(qphy->iface_clk); - if (ret == -EPROBE_DEFER) - return ret; - qphy->iface_clk = NULL; - dev_dbg(dev, "failed to get iface clk, %d\n", ret); - } + qphy->iface_clk = devm_clk_get_optional(dev, "iface"); + if (IS_ERR(qphy->iface_clk)) + return PTR_ERR(qphy->iface_clk); qphy->phy_reset = devm_reset_control_get_by_index(&pdev->dev, 0); if (IS_ERR(qphy->phy_reset)) { From patchwork Wed Apr 10 06:13:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10893205 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 ED093922 for ; Wed, 10 Apr 2019 06:13:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D181C289E2 for ; Wed, 10 Apr 2019 06:13:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C542D289E8; Wed, 10 Apr 2019 06:13:38 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7F85C289E2 for ; Wed, 10 Apr 2019 06:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0AAYWSikEurzc3OWGi8ueODDgdJhAP8h0oT7hgu7leo=; b=jERqJq1pFrmicq mTPd+LgIOF8mehrVhP28rIcoFOb6BJbyxaZLCG7KGLC30io7iNAh4Ixn0BSnLPQIU7C+mDyvwVDWl Gv3YDGW2YEIrbSuTzIhpFF04Inat7cVXwky+R/GG4ixtKFfQwDa1tvLq5hO7H9HsO04MQ1gfOO0W9 kWk9DKtzn0nUU8fimfz4JOanMrfUu68ZIm/no2kAaG2VcP+anWEfxStz+Q8pW0e8Bd1Rp/sjS8LJM ezmNYWryBM/MtbERJYbH/slnqOvb83iMaBymr9XxkGsfc+gk090g/wJTHkdKfUYO8aOcQBOxLTRbV 8jhOunhzK/iG45Cc2aag==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE6UK-0000CL-TL; Wed, 10 Apr 2019 06:13:36 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE6U8-0008N5-Ah; Wed, 10 Apr 2019 06:13:25 +0000 X-UUID: b196645706044e0bb0293fe018474dc3-20190409 X-UUID: b196645706044e0bb0293fe018474dc3-20190409 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1426235234; Tue, 09 Apr 2019 22:13:17 -0800 Received: from MTKMBS31N1.mediatek.inc (172.27.4.69) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 9 Apr 2019 23:13:15 -0700 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:12 +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:10 +0800 From: Chunfeng Yun To: Kishon Vijay Abraham I Subject: [v2 PATCH 3/4] phy: socionext: get optional clock by devm_clk_get_optional() Date: Wed, 10 Apr 2019 14:13:05 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190409_231324_370585_645DFECE X-CRM114-Status: UNSURE ( 9.47 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Brown , Grygorii Strashko , Masami Hiramatsu , Kunihiko Hayashi , Masahiro Yamada , Martin Blumenstingl , Kevin Hilman , Motoya Tanigawa , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Andy Gross , Matthias Brugger , linux-arm-msm@vger.kernel.org, Chunfeng Yun , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_clk_get_optional() to get optional clock Cc: Kunihiko Hayashi Signed-off-by: Chunfeng Yun Reviewed-by: Kunihiko Hayashi --- v2: add Reviewed-by Kunihiko Hayashi --- drivers/phy/socionext/phy-uniphier-usb3hs.c | 10 +++------- drivers/phy/socionext/phy-uniphier-usb3ss.c | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/phy/socionext/phy-uniphier-usb3hs.c b/drivers/phy/socionext/phy-uniphier-usb3hs.c index b1b048be6166..50f379fc4e06 100644 --- a/drivers/phy/socionext/phy-uniphier-usb3hs.c +++ b/drivers/phy/socionext/phy-uniphier-usb3hs.c @@ -335,13 +335,9 @@ static int uniphier_u3hsphy_probe(struct platform_device *pdev) if (IS_ERR(priv->clk_parent)) return PTR_ERR(priv->clk_parent); - priv->clk_ext = devm_clk_get(dev, "phy-ext"); - if (IS_ERR(priv->clk_ext)) { - if (PTR_ERR(priv->clk_ext) == -ENOENT) - priv->clk_ext = NULL; - else - return PTR_ERR(priv->clk_ext); - } + priv->clk_ext = devm_clk_get_optional(dev, "phy-ext"); + if (IS_ERR(priv->clk_ext)) + return PTR_ERR(priv->clk_ext); priv->rst = devm_reset_control_get_shared(dev, "phy"); if (IS_ERR(priv->rst)) diff --git a/drivers/phy/socionext/phy-uniphier-usb3ss.c b/drivers/phy/socionext/phy-uniphier-usb3ss.c index 4be95679c7d8..ec231e40ef2a 100644 --- a/drivers/phy/socionext/phy-uniphier-usb3ss.c +++ b/drivers/phy/socionext/phy-uniphier-usb3ss.c @@ -238,13 +238,9 @@ static int uniphier_u3ssphy_probe(struct platform_device *pdev) if (IS_ERR(priv->clk)) return PTR_ERR(priv->clk); - priv->clk_ext = devm_clk_get(dev, "phy-ext"); - if (IS_ERR(priv->clk_ext)) { - if (PTR_ERR(priv->clk_ext) == -ENOENT) - priv->clk_ext = NULL; - else - return PTR_ERR(priv->clk_ext); - } + priv->clk_ext = devm_clk_get_optional(dev, "phy-ext"); + if (IS_ERR(priv->clk_ext)) + return PTR_ERR(priv->clk_ext); priv->rst = devm_reset_control_get_shared(dev, "phy"); if (IS_ERR(priv->rst)) From patchwork Wed Apr 10 06:13:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10893215 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 DA353922 for ; Wed, 10 Apr 2019 06:14:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC37B2889C for ; Wed, 10 Apr 2019 06:14:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD14F289E5; Wed, 10 Apr 2019 06:14:16 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 57A742889C for ; Wed, 10 Apr 2019 06:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LtqJuw460D1xR/YfGO9GaFKKxAVlMledlRsTEDfdMHo=; b=QylxxnZfvROvln 51/0IGWlqNNnRlzJ89qfsM2VOP08B9lvux1Q6FbtINCCvLfBEUP/0rTftHphlko6NXTPjudXsOBFd qWfiHXQTpVdxUVRkcMLWshyhvMqKLSDjlKZyXK39H/6X0wNBhv4IP+XG7beLWTT92fdfbVqJn7XyM JNsykpho3Ko3L8gubqYYgLImfRlmoeZ5ZAYQD1hfBzy2JZBPZsTGdiC5rLTEo3jRlwgR9r5mzMUc2 gEMyMLiNjKUnDVgdHQJuVQGQH0ehkXsbXN0zcYq7eiBAIftGp9+nMGH6q5ErG6kL1eJldI33wJrFc toSLUX1+YYVDCCL2j46w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE6Ux-00011a-TC; Wed, 10 Apr 2019 06:14:15 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hE6Uw-0000yF-5a; Wed, 10 Apr 2019 06:14:15 +0000 X-UUID: a065b1e2db7542c19629054e48f191b4-20190409 X-UUID: a065b1e2db7542c19629054e48f191b4-20190409 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1681973044; Tue, 09 Apr 2019 22:13:18 -0800 Received: from MTKMBS31DR.mediatek.inc (172.27.6.102) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 9 Apr 2019 23:13:17 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 10 Apr 2019 14:13:14 +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:12 +0800 From: Chunfeng Yun To: Kishon Vijay Abraham I Subject: [v2 PATCH 4/4] phy: phy-meson-gxl-usb2: get optional clock by devm_clk_get_optional() Date: Wed, 10 Apr 2019 14:13:06 +0800 Message-ID: <9f04a619e8a2cc44f5b1fe299a08f237f069d56d.1554874961.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190409_231414_212252_BDB7FB2D X-CRM114-Status: GOOD ( 10.42 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Brown , Grygorii Strashko , Masami Hiramatsu , Kunihiko Hayashi , Masahiro Yamada , Martin Blumenstingl , Kevin Hilman , Motoya Tanigawa , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Andy Gross , Matthias Brugger , linux-arm-msm@vger.kernel.org, Chunfeng Yun , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use devm_clk_get_optional() to get optional clock Cc: Martin Blumenstingl Signed-off-by: Chunfeng Yun Acked-by: Martin Blumenstingl Reviewed-by: Jerome Brunet Tested-by: Martin Blumenstingl --- v2: add Acked-by Martin Blumenstingl --- drivers/phy/amlogic/phy-meson-gxl-usb2.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c index 148ef0bdb9c1..4cbee412f2b0 100644 --- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c +++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c @@ -261,14 +261,9 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev) if (IS_ERR(priv->regmap)) return PTR_ERR(priv->regmap); - priv->clk = devm_clk_get(dev, "phy"); - if (IS_ERR(priv->clk)) { - ret = PTR_ERR(priv->clk); - if (ret == -ENOENT) - priv->clk = NULL; - else - return ret; - } + priv->clk = devm_clk_get_optional(dev, "phy"); + if (IS_ERR(priv->clk)) + return PTR_ERR(priv->clk); priv->reset = devm_reset_control_get_optional_shared(dev, "phy"); if (IS_ERR(priv->reset))