Re: [PATCH v3 1/5] device property: Allow const parameter to dev_fwnode()
From: Andy Shevchenko
Date: Tue Oct 04 2022 - 05:39:28 EST
On Tue, Oct 04, 2022 at 12:21:25PM +0300, Andy Shevchenko wrote:
> It's not fully correct to take a const parameter pointer to a struct
> and return a non-const pointer to a member of that struct.
>
> Instead, introduce a const version of the dev_fwnode() API which takes
> and returns const pointers and use it where it's applicable.
>
> With this, convert dev_fwnode() to be a macro wrapper on top of const
> and non-const APIs that chooses one based on the type.
Hmm... it missed the device_get_match_data() implementation (reverse) change
somehow. And it still compiles to me, probably I rebased wrongly and the hunk
went to another patch. I'll investigate and resend as v4 the fixed version.
--
With Best Regards,
Andy Shevchenko