[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6bc78502-7587-eb9c-237f-d3f031979d42@gmail.com>
Date: Wed, 7 Nov 2018 06:55:14 -0800
From: Frank Rowand <frowand.list@...il.com>
To: Michael Ellerman <mpe@...erman.id.au>,
Rob Herring <robh+dt@...nel.org>,
Pantelis Antoniou <pantelis.antoniou@...sulko.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Alan Tull <atull@...nel.org>, Moritz Fischer <mdf@...nel.org>
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
devicetree@...r.kernel.org, linux-fpga@...r.kernel.org
Subject: Re: [PATCH v6 07/18] of: dynamic: change type of
of_{at,de}tach_node() to void
On 11/7/18 4:08 AM, Michael Ellerman wrote:
> frowand.list@...il.com writes:
>
>> From: Frank Rowand <frank.rowand@...y.com>
>>
>> of_attach_node() and of_detach_node() always return zero, so
>> their return value is meaningless.
>
> But should they always return zero?
>
> At least __of_attach_node_sysfs() can fail in several ways.
Sigh. And of_reconfig_notify() can fail. And at one point in the
history the return value of of_reconfig_notify() was returned by
of_attach_node() if of_reconfig_notify() failed.
> And there's also this in __of_detach_node() which should probably be
> returning an error:
>
> if (WARN_ON(of_node_check_flag(np, OF_DETACHED)))
> return;
>
>
> Seems to me we should instead be fixing these to propagate errors,
> rather than hiding them?
The history of how of_attach_node() stopped propagating errors is
a bit more complex than I want to dig into at the moment. So I'll
drop this patch from the series and add investigating this onto
my todo list. I suspect that the result of investigating will be
that error return values should not be ignored in of_attach_node()
and of_detach_node(), but should instead be propagated to the
callers, as you suggest.
-Frank
>
> cheers
>
Powered by blists - more mailing lists