Skip to content

Commit 9a9ab30

Browse files
committed
MIPS: generic: Fix machine compatible matching
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 <jhogan@kernel.org> Reviewed-by: Paul Burton <paul.burton@mips.com> Reviewed-by: Matt Redfearn <matt.redfearn@mips.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/18580/
1 parent 6045f24 commit 9a9ab30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/mips/include/asm/machine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ mips_machine_is_compatible(const struct mips_machine *mach, const void *fdt)
5252
if (!mach->matches)
5353
return NULL;
5454

55-
for (match = mach->matches; match->compatible; match++) {
55+
for (match = mach->matches; match->compatible[0]; match++) {
5656
if (fdt_node_check_compatible(fdt, 0, match->compatible) == 0)
5757
return match;
5858
}

0 commit comments

Comments
 (0)