diff mbox series

[5/5] usb: chipidea: msm: get optional clock by devm_clk_get_optional()

Message ID 2f4b8d77c6ec99ef6cc8e71155d820e080ad9af5.1553937592.git.chunfeng.yun@mediatek.com (mailing list archive)
State Superseded
Commit fcafadf71a252009f1d0663b8fcf4bd57f4f2c66
Headers show
Series [1/5] usb: xhci-mtk: get optional clock by devm_clk_get_optional() | expand

Commit Message

Chunfeng Yun (云春峰) March 30, 2019, 9:28 a.m. UTC
Use devm_clk_get_optional() to get optional clock

Cc: Peter Chen <Peter.Chen@nxp.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/chipidea/ci_hdrc_msm.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Peter Chen April 4, 2019, 7:28 a.m. UTC | #1
>  drivers/usb/chipidea/ci_hdrc_msm.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c
> b/drivers/usb/chipidea/ci_hdrc_msm.c
> index 880009987460..b8b3caad889c 100644
> --- a/drivers/usb/chipidea/ci_hdrc_msm.c
> +++ b/drivers/usb/chipidea/ci_hdrc_msm.c
> @@ -205,12 +205,9 @@ static int ci_hdrc_msm_probe(struct platform_device
> *pdev)
>  	if (IS_ERR(clk))
>  		return PTR_ERR(clk);
> 
> -	ci->fs_clk = clk = devm_clk_get(&pdev->dev, "fs");
> -	if (IS_ERR(clk)) {
> -		if (PTR_ERR(clk) == -EPROBE_DEFER)
> -			return -EPROBE_DEFER;
> -		ci->fs_clk = NULL;
> -	}
> +	ci->fs_clk = clk = devm_clk_get_optional(&pdev->dev, "fs");
> +	if (IS_ERR(clk))
> +		return PTR_ERR(clk);
> 
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
>  	ci->base = devm_ioremap_resource(&pdev->dev, res);
> --
> 2.20.1

Acked-by: Peter Chen <peter.chen@nxp.com>
diff mbox series

Patch

diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
index 880009987460..b8b3caad889c 100644
--- a/drivers/usb/chipidea/ci_hdrc_msm.c
+++ b/drivers/usb/chipidea/ci_hdrc_msm.c
@@ -205,12 +205,9 @@  static int ci_hdrc_msm_probe(struct platform_device *pdev)
 	if (IS_ERR(clk))
 		return PTR_ERR(clk);
 
-	ci->fs_clk = clk = devm_clk_get(&pdev->dev, "fs");
-	if (IS_ERR(clk)) {
-		if (PTR_ERR(clk) == -EPROBE_DEFER)
-			return -EPROBE_DEFER;
-		ci->fs_clk = NULL;
-	}
+	ci->fs_clk = clk = devm_clk_get_optional(&pdev->dev, "fs");
+	if (IS_ERR(clk))
+		return PTR_ERR(clk);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	ci->base = devm_ioremap_resource(&pdev->dev, res);