[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: [PATCH v2] mmc: sdhci-xenon: Fix clock resource by adding an optional bus clock
From:       Jisheng Zhang <Jisheng.Zhang () synaptics ! com>
Date:       2017-09-30 6:17:53
Message-ID: 20170930141753.7c4e34ea () xhacker ! debian
[Download RAW message or body]

Hi Thomas,

On Sat, 30 Sep 2017 08:07:10 +0200 Thomas Petazzoni wrote:

> Hello,
> 
> On Sat, 30 Sep 2017 10:41:09 +0800, Jisheng Zhang wrote:
> 
> > > +	priv->axi_clk = devm_clk_get(&pdev->dev, "axi");
> > > +	if (IS_ERR(priv->axi_clk)) {
> > > +		err = PTR_ERR(priv->axi_clk);
> > > +		if (err == -EPROBE_DEFER)
> > > +			goto err_clk;
> > > +		priv->axi_clk = NULL;    
> > 
> > IMHO, this assignment could be removed. What do you think?  
> 
> No, because if the clock is not present in the Device Tree,
> priv->axi_clk will contain an error code encoded as a pointer, so
> priv->axi_clk will not be NULL. Hence the rest of the code that will

FWICT, the clk_disable_unprepare() could also check whether the clk
is err, am I wrong?

> operate on this clock will believe there is a valid clock pointed by
> priv->axi_clk. So we really want to reset it to NULL when there was an
> error getting the clock.
> 
> Best regards,
> 
> Thomas


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic