Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM/of: allow *machine_desc.dt_compat to be const

This allows dt_compat to point to a constant list of compatible strings.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>

authored by

Uwe Kleine-König and committed by
Rob Herring
7b482c83 88af7f58

+5 -5
+1 -1
arch/arm/include/asm/mach/arch.h
··· 19 19 unsigned int nr; /* architecture number */ 20 20 const char *name; /* architecture name */ 21 21 unsigned long atag_offset; /* tagged list (relative) */ 22 - const char **dt_compat; /* array of device tree 22 + const char *const *dt_compat; /* array of device tree 23 23 * 'compatible' strings */ 24 24 25 25 unsigned int nr_irqs; /* number of IRQs */
+2 -2
drivers/of/fdt.c
··· 107 107 * of_fdt_match - Return true if node matches a list of compatible values 108 108 */ 109 109 int of_fdt_match(struct boot_param_header *blob, unsigned long node, 110 - const char **compat) 110 + const char *const *compat) 111 111 { 112 112 unsigned int tmp, score = 0; 113 113 ··· 541 541 /** 542 542 * of_flat_dt_match - Return true if node matches a list of compatible values 543 543 */ 544 - int __init of_flat_dt_match(unsigned long node, const char **compat) 544 + int __init of_flat_dt_match(unsigned long node, const char *const *compat) 545 545 { 546 546 return of_fdt_match(initial_boot_params, node, compat); 547 547 }
+2 -2
include/linux/of_fdt.h
··· 71 71 unsigned long node, 72 72 const char *compat); 73 73 extern int of_fdt_match(struct boot_param_header *blob, unsigned long node, 74 - const char **compat); 74 + const char *const *compat); 75 75 extern void of_fdt_unflatten_tree(unsigned long *blob, 76 76 struct device_node **mynodes); 77 77 ··· 88 88 extern void *of_get_flat_dt_prop(unsigned long node, const char *name, 89 89 unsigned long *size); 90 90 extern int of_flat_dt_is_compatible(unsigned long node, const char *name); 91 - extern int of_flat_dt_match(unsigned long node, const char **matches); 91 + extern int of_flat_dt_match(unsigned long node, const char *const *matches); 92 92 extern unsigned long of_get_flat_dt_root(void); 93 93 94 94 extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,