mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-12 20:35:23 +02:00
UPSTREAM: of: Change of_machine_is_compatible() to return bool
of_machine_is_compatible() currently returns a positive integer if it
finds a match. However none of the callers ever check the value, they
all treat it as a true/false.
So change of_machine_is_compatible() to return bool, which will allow
the implementation to be changed in a subsequent patch.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231214103152.12269-2-mpe@ellerman.id.au
Bug: 339841691
(cherry picked from commit cefdb366dc
)
Change-Id: I7d1369fd45bf3aeb4d2bacf4da51b9955185e296
Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
This commit is contained in:
parent
f589c195b4
commit
dcc1709075
|
@ -419,10 +419,9 @@ bool of_machine_compatible_match(const char *const *compats)
|
|||
* of_machine_is_compatible - Test root of device tree for a given compatible value
|
||||
* @compat: compatible string to look for in root node's compatible property.
|
||||
*
|
||||
* Return: A positive integer if the root node has the given value in its
|
||||
* compatible property.
|
||||
* Return: true if the root node has the given value in its compatible property.
|
||||
*/
|
||||
int of_machine_is_compatible(const char *compat)
|
||||
bool of_machine_is_compatible(const char *compat)
|
||||
{
|
||||
struct device_node *root;
|
||||
int rc = 0;
|
||||
|
|
|
@ -402,7 +402,7 @@ extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align));
|
|||
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_is_compatible(const char *compat);
|
||||
bool of_machine_compatible_match(const char *const *compats);
|
||||
|
||||
extern int of_add_property(struct device_node *np, struct property *prop);
|
||||
|
|
Loading…
Reference in New Issue
Block a user