Re: [PATCH v4 15/15] iio: dac: ltc2688: Use device_for_each_child_node_scoped()

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

 



On Mon, 19 Feb 2024 13:48:27 +0200
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:

> On Sat, Feb 17, 2024 at 04:42:49PM +0000, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>
> > 
> > Switching to the _scoped() version removes the need for manual
> > calling of fwnode_handle_put() in the paths where the code
> > exits the loop early. In this case that's all in error paths.  
> 
> ...
> 
> >  			span = ltc2688_span_lookup(st, (int)tmp[0] / 1000,
> >  						   tmp[1] / 1000);
> > -			if (span < 0) {
> > -				fwnode_handle_put(child);
> > +			if (span < 0)
> >  				return dev_err_probe(dev, -EINVAL,
> >  						     "output range not valid:[%d %d]\n",
> >  						     tmp[0], tmp[1]);  
> 
> Last minute observation, should not we return span instead of -EINVAL?
> (Haven't checked the semantics of the former though.)
It returns 0 or -EINVAL, so yes we should use span here.

> 
> ...
> 
> > +		if (ret)
> >  			return dev_err_probe(dev, -EINVAL,
> >  					     "failed to set chan settings\n");  
> 
> Ditto.

Definitely on that one. 

I'll aim to fold those two in whilst picking this up with a note in the patch description.
(or I'll incorporate them if I do a v5 for other reasons!)

Thanks,

Jonathan

> 
> 





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux