[PATCH 1/2] of: Add of_machine_compatible_match()

Michael Ellerman mpe at ellerman.id.au
Fri Aug 3 20:31:03 AEST 2018


Rob Herring <robh+dt at kernel.org> writes:
> On Mon, Jul 30, 2018 at 7:15 AM Michael Ellerman <mpe at ellerman.id.au> wrote:
...
>> diff --git a/include/linux/of.h b/include/linux/of.h
>> index 4d25e4f952d9..05e3e23a3a57 100644
>> --- a/include/linux/of.h
>> +++ b/include/linux/of.h
>> @@ -389,6 +389,7 @@ extern int of_alias_get_id(struct device_node *np, const char *stem);
>>  extern int of_alias_get_highest_id(const char *stem);
>>
>>  extern int of_machine_is_compatible(const char *compat);
>> +extern bool of_machine_compatible_match(const char *const *compats);
>
> Would be nice if of_machine_is_compatible could be implemented in
> terms of of_machine_compatible_match like this:
>
> int of_machine_is_compatible(const char *compat)
> {
>   const char *compats[] = { compat, NULL };
>   return of_machine_is_compatible(compats);
> }
>
> Probably can be inline too.

Yeah good idea, I'll do a v2 next week.

cheers


More information about the Linuxppc-dev mailing list