Re: [PATCH v1] reset: Make optional stuff optional for all users

From: Andy Shevchenko
Date: Mon Apr 03 2017 - 16:48:06 EST


On Mon, Apr 3, 2017 at 7:04 PM, Philipp Zabel <p.zabel@xxxxxxxxxxxxxx> wrote:
> On Mon, 2017-04-03 at 18:23 +0300, Andy Shevchenko wrote:
>> On Mon, 2017-04-03 at 17:09 +0200, Philipp Zabel wrote:
>> > On Mon, 2017-04-03 at 14:33 +0000, Shevchenko, Andriy wrote:
>> > > On Mon, 2017-04-03 at 17:31 +0300, Andy Shevchenko wrote:

>> I really don't like ping-ponging of the code. Perhaps you would fix it
>> once for the best now?
>
> How about:

Below looks fine to me, one nit still and I would like to test it tomorrow.
Thanks for taking care.

> +struct reset_control *__reset_control_get(struct device *dev, const char *id,
> + int index, bool shared, bool optional)
> +{
> + if (dev->of_node)
> + return __of_reset_control_get(dev->of_node, id, index, shared,
> +
optional);
> + else

Redundant.

> + return optional ? NULL : ERR_PTR(-EINVAL);
> +}
> +EXPORT_SYMBOL_GPL(__reset_control_get);

--
With Best Regards,
Andy Shevchenko