回覆: [PATCH net-next v4 3/7] net: ftgmac100: Add reset toggling for Aspeed SOCs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Smatch

Thank you for your reply.

> > +	struct reset_control *rst;
> >
> >  	/* AST2500/AST2600 RMII ref clock gate */
> >  	struct clk *rclk;
> > @@ -1979,6 +1981,22 @@ static int ftgmac100_probe(struct
> platform_device *pdev)
> >  				  priv->base + FTGMAC100_OFFSET_TM);
> >  	}
> >
> > +	priv->rst = devm_reset_control_get_optional_exclusive(priv->dev, NULL);
> > +	if (IS_ERR(priv->rst))
> > +		goto err_register_netdev;
> 
> Hi Jacky,
> 
> The goto on the line above will result in this function returning err.
> However, it seems that err is set to 0 here.
> And perhaps it should be set to PTR_ERR(priv->rst).
> 
> Flagged by Smatch.

Agree.
I will add that err is assigned by PTR_ERR(priv->rst) for error handling in next version.

priv->rst = devm_reset_control_get_optional_exclusive(priv->dev, NULL);
if (IS_ERR(priv->rst)) {
	err = PTR_ERR(priv->rst);
	goto err_register_netdev;
}

Otherwise, err may be zero when getting an error from devm_reset_control_get_Optional_exclusive().
Thank you for your kind reminder.

Thanks,
Jacky




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux