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

of: Hide of_default_bus_match_table[]

This isn't used outside this file. Hide the array in the C file.

Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Acked-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20241204194806.2665589-1-swboyd@chromium.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Stephen Boyd and committed by
Rob Herring (Arm)
3c48780d 16ef9c9d

+11 -14
+11 -12
drivers/of/platform.c
··· 24 24 25 25 #include "of_private.h" 26 26 27 - const struct of_device_id of_default_bus_match_table[] = { 28 - { .compatible = "simple-bus", }, 29 - { .compatible = "simple-mfd", }, 30 - { .compatible = "isa", }, 31 - #ifdef CONFIG_ARM_AMBA 32 - { .compatible = "arm,amba-bus", }, 33 - #endif /* CONFIG_ARM_AMBA */ 34 - {} /* Empty terminated list */ 35 - }; 36 - 37 27 /** 38 28 * of_find_device_by_node - Find the platform_device associated with a node 39 29 * @np: Pointer to device tree node ··· 474 484 const struct of_dev_auxdata *lookup, 475 485 struct device *parent) 476 486 { 477 - return of_platform_populate(root, of_default_bus_match_table, lookup, 478 - parent); 487 + static const struct of_device_id match_table[] = { 488 + { .compatible = "simple-bus", }, 489 + { .compatible = "simple-mfd", }, 490 + { .compatible = "isa", }, 491 + #ifdef CONFIG_ARM_AMBA 492 + { .compatible = "arm,amba-bus", }, 493 + #endif /* CONFIG_ARM_AMBA */ 494 + {} /* Empty terminated list */ 495 + }; 496 + 497 + return of_platform_populate(root, match_table, lookup, parent); 479 498 } 480 499 EXPORT_SYMBOL_GPL(of_platform_default_populate); 481 500
-2
include/linux/of_platform.h
··· 47 47 { .compatible = _compat, .phys_addr = _phys, .name = _name, \ 48 48 .platform_data = _pdata } 49 49 50 - extern const struct of_device_id of_default_bus_match_table[]; 51 - 52 50 /* Platform drivers register/unregister */ 53 51 extern struct platform_device *of_device_alloc(struct device_node *np, 54 52 const char *bus_id,