Skip to content

Commit

Permalink
MIPS: generic: Fix machine compatible matching
Browse files Browse the repository at this point in the history
We now have a platform (Ranchu) in the "generic" platform which matches
based on the FDT compatible string using mips_machine_is_compatible(),
however that function doesn't stop at a blank struct
of_device_id::compatible as that is an array in the struct, not a
pointer to a string.

Fix the loop completion to check the first byte of the compatible array
rather than the address of the compatible array in the struct.

Fixes: eed0eab ("MIPS: generic: Introduce generic DT-based board support")
Signed-off-by: James Hogan <[email protected]>
Reviewed-by: Paul Burton <[email protected]>
Reviewed-by: Matt Redfearn <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/18580/
  • Loading branch information
amalon committed Feb 5, 2018
1 parent 6045f24 commit 9a9ab30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mips/include/asm/machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mips_machine_is_compatible(const struct mips_machine *mach, const void *fdt)
if (!mach->matches)
return NULL;

for (match = mach->matches; match->compatible; match++) {
for (match = mach->matches; match->compatible[0]; match++) {
if (fdt_node_check_compatible(fdt, 0, match->compatible) == 0)
return match;
}
Expand Down

0 comments on commit 9a9ab30

Please sign in to comment.