diff options
author | James Hogan <jhogan@kernel.org> | 2018-02-03 01:14:09 +0300 |
---|---|---|
committer | James Hogan <jhogan@kernel.org> | 2018-02-05 13:37:48 +0300 |
commit | 9a9ab3078e2744a1a55163cfaec73a5798aae33e (patch) | |
tree | af2f5f4b552b1db863e612c6dca9f01022603465 /arch/mips/include | |
parent | 6045f241b48f07b2fb80905bf49671f457a8c037 (diff) | |
download | linux-9a9ab3078e2744a1a55163cfaec73a5798aae33e.tar.xz |
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: eed0eabd12ef ("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/
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/machine.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/include/asm/machine.h b/arch/mips/include/asm/machine.h index e0d9b373d415..f83879dadd1e 100644 --- a/arch/mips/include/asm/machine.h +++ b/arch/mips/include/asm/machine.h @@ -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; } |