Re: [PATCH v3 1/1] device property: Allow error pointer to be passed to fwnode APIs

From: Andy Shevchenko
Date: Tue Mar 08 2022 - 07:23:06 EST


On Tue, Mar 08, 2022 at 01:15:22PM +0200, Sakari Ailus wrote:
> Hi Andy,
>
> This makes secondary handling quite a big nicer, thanks!

You are welcome!

> A few comments below. Apart from that,
>
> Reviewed-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>

Thanks!

...

> On Mon, Mar 07, 2022 at 10:29:49PM +0200, Andy Shevchenko wrote:

> > #include <linux/acpi.h>
> > #include <linux/export.h>
> > +#include <linux/fwnode.h>
>
> Is this intended? linux/property.h already includes linux/fwnode.h.
>
> > #include <linux/kernel.h>
> > #include <linux/of.h>
> > #include <linux/of_address.h>

Yeah, this is a bit messy in the headers. I will drop the inclusion,
but in the future it would be good to reshuffle property.h, fwnode.h,
and perhaps extract swnode.h.

...

> > bool ret;
> >
> > + if (IS_ERR_OR_NULL(fwnode))
> > + return false;

> > + if (ret == true)
>
> It's already bool. I'd instead use:
>
> if (ret)

Right, will amend this.

> > + return ret;

--
With Best Regards,
Andy Shevchenko