On Thu, Jul 20, 2023 at 10:08:34PM +0800, Yuanjun Gong wrote: > in gsbi_probe(), the return value of function clk_prepare_enable() > should be checked, since it may fail. using devm_clk_get_enabled() > instead of devm_clk_get() and clk_prepare_enable() can avoid this > problem. > Nice, thank you. > Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@xxxxxxx> > --- > drivers/soc/qcom/qcom_gsbi.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/soc/qcom/qcom_gsbi.c b/drivers/soc/qcom/qcom_gsbi.c > index f1742e5bddb9..de94a20d5814 100644 > --- a/drivers/soc/qcom/qcom_gsbi.c > +++ b/drivers/soc/qcom/qcom_gsbi.c > @@ -178,12 +178,10 @@ static int gsbi_probe(struct platform_device *pdev) > > dev_info(&pdev->dev, "GSBI port protocol: %d crci: %d\n", > gsbi->mode, gsbi->crci); > - gsbi->hclk = devm_clk_get(&pdev->dev, "iface"); > + gsbi->hclk = devm_clk_get_enabled(&pdev->dev, "iface"); > if (IS_ERR(gsbi->hclk)) > return PTR_ERR(gsbi->hclk); > > - clk_prepare_enable(gsbi->hclk); > - > writel_relaxed((gsbi->mode << GSBI_PROTOCOL_SHIFT) | gsbi->crci, > base + GSBI_CTRL_REG); > > @@ -212,8 +210,6 @@ static int gsbi_probe(struct platform_device *pdev) > platform_set_drvdata(pdev, gsbi); > > ret = of_platform_populate(node, NULL, NULL, &pdev->dev); This can be further cleaned up by return of_platform_populate() directly, and removing the ret variable. Can you please do that as well? Thanks, Bjorn > - if (ret) > - clk_disable_unprepare(gsbi->hclk); > return ret; > } > > -- > 2.17.1 >