Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1557359

Re: [PATCH v2 2/2] reset: make optional functions really optional

From Philipp Zabel <p.zabel@pengutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/2] reset: make optional functions really optional
Date 2017-01-12 12:00 +0100
Message-ID <sYLgS-2XE-19@gated-at.bofh.it> (permalink)
References <sSZmx-262-5@gated-at.bofh.it> <sSZmx-262-7@gated-at.bofh.it> <sXFGx-33B-11@gated-at.bofh.it> <sXLVD-74k-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Ramiro,

Am Montag, den 09.01.2017, 17:19 +0000 schrieb Ramiro Oliveira:
> Hi Philipp
> 
> On 1/9/2017 10:45 AM, Philipp Zabel wrote:
> > Hi Ramiro,
> > 
> > Am Dienstag, den 27.12.2016, 12:37 +0000 schrieb Ramiro Oliveira:
> >> The optional functions weren't really optional so this patch makes them
> >> really optional.
> > 
> > Please add a bit of detail to the description. Since this changes the
> > API, you should mention that the reset_control_get_optional variants now
> > return NULL instead of an error if there is no matching reset phandle in
> > the device tree and that the reset_control_* functions accept NULL rstc
> > pointers.
> > 
> 
> Would you be ok with something like this:
> 
> "The *_get_optional_* functions weren't really optional so this patch makes them
> really optional.
> 
> These *_get_optional_* functions will now return NULL instead of an error if no
> matching reset phandle is found in the DT, and all the reset_control_* functions
> now accept NULL rstc pointers

Yes, that looks fine to me.

[...]
> >> @@ -273,13 +295,13 @@ struct reset_control *__of_reset_control_get(struct device_node *node,
> >>  		index = of_property_match_string(node,
> >>  						 "reset-names", id);
> >>  		if (index < 0)
> >> -			return ERR_PTR(-ENOENT);
> >> +			return optional ? NULL : ERR_PTR(-ENOENT);
> > 
> > of_property_match_string can return -EINVAL, -ENODATA, or -EILSEQ.
> > I think -EILSEQ should still be returned.
> > 
> 
> I'll make the function return NULL, -ENOENT, or -EILSEQ.

Ok.

> >>  	}
> >>  
> >>  	ret = of_parse_phandle_with_args(node, "resets", "#reset-cells",
> >>  					 index, &args);
> >>  	if (ret)
> >> -		return ERR_PTR(ret);
> >> +		return optional ? NULL : ERR_PTR(ret);
> > 
> > of_parse_phandle_with_args can return -ENOENT or -EINVAL.
> > I think -EINVAL should still be returned.
> > 
> 
> Same as above. I'll make the function return NULL, -ENOENT, or -EINVAL.

thanks
Philipp

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 2/2] reset: make optional functions really optional Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-09 11:50 +0100
  Re: [PATCH v2 2/2] reset: make optional functions really optional Ramiro Oliveira <Ramiro.Oliveira@synopsys.com> - 2017-01-09 18:30 +0100
    Re: [PATCH v2 2/2] reset: make optional functions really optional Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-12 12:00 +0100

csiph-web