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

of: remove of_default_bus_ids

This list used was by only two platforms with all other platforms defining an
own list of valid bus id's to pass to of_platform_bus_probe. This patch:

i) copies the default list to the two platforms that depended on it (powerpc)
ii) remove the usage of of_default_bus_ids in of_platform_bus_probe
iii) removes the definition of the list from all architectures that defined it

Passing a NULL 'matches' parameter to of_platform_bus_probe is still valid; the
function returns no error in that case as the NULL value is equivalent to an
empty list.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
[grant.likely@secretlab.ca: added __initdata annotations, warn on and return error on missing match table, and fix whitespace errors]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

authored by

Jonas Bonn and committed by
Grant Likely
c0dd394c c6085584

+28 -81
+1 -1
arch/microblaze/kernel/Makefile
··· 16 16 17 17 obj-y += dma.o exceptions.o \ 18 18 hw_exception_handler.o init_task.o intc.o irq.o \ 19 - of_platform.o process.o prom.o prom_parse.o ptrace.o \ 19 + process.o prom.o prom_parse.o ptrace.o \ 20 20 setup.o signal.o sys_microblaze.o timer.o traps.o reset.o 21 21 22 22 obj-y += cpu/
-49
arch/microblaze/kernel/of_platform.c
··· 1 - /* 2 - * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corp. 3 - * <benh@kernel.crashing.org> 4 - * and Arnd Bergmann, IBM Corp. 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU General Public License 8 - * as published by the Free Software Foundation; either version 9 - * 2 of the License, or (at your option) any later version. 10 - * 11 - */ 12 - 13 - #undef DEBUG 14 - 15 - #include <linux/string.h> 16 - #include <linux/kernel.h> 17 - #include <linux/init.h> 18 - #include <linux/module.h> 19 - #include <linux/mod_devicetable.h> 20 - #include <linux/pci.h> 21 - #include <linux/of.h> 22 - #include <linux/of_device.h> 23 - #include <linux/of_platform.h> 24 - 25 - #include <linux/errno.h> 26 - #include <linux/topology.h> 27 - #include <asm/atomic.h> 28 - 29 - /* 30 - * The list of OF IDs below is used for matching bus types in the 31 - * system whose devices are to be exposed as of_platform_devices. 32 - * 33 - * This is the default list valid for most platforms. This file provides 34 - * functions who can take an explicit list if necessary though 35 - * 36 - * The search is always performed recursively looking for children of 37 - * the provided device_node and recursively if such a children matches 38 - * a bus type in the list 39 - */ 40 - 41 - const struct of_device_id of_default_bus_ids[] = { 42 - { .type = "soc", }, 43 - { .compatible = "soc", }, 44 - { .type = "plb5", }, 45 - { .type = "plb4", }, 46 - { .type = "opb", }, 47 - { .type = "simple", }, 48 - {}, 49 - };
-24
arch/powerpc/kernel/of_platform.c
··· 28 28 #include <asm/ppc-pci.h> 29 29 #include <asm/atomic.h> 30 30 31 - /* 32 - * The list of OF IDs below is used for matching bus types in the 33 - * system whose devices are to be exposed as of_platform_devices. 34 - * 35 - * This is the default list valid for most platforms. This file provides 36 - * functions who can take an explicit list if necessary though 37 - * 38 - * The search is always performed recursively looking for children of 39 - * the provided device_node and recursively if such a children matches 40 - * a bus type in the list 41 - */ 42 - 43 - const struct of_device_id of_default_bus_ids[] = { 44 - { .type = "soc", }, 45 - { .compatible = "soc", }, 46 - { .type = "spider", }, 47 - { .type = "axon", }, 48 - { .type = "plb5", }, 49 - { .type = "plb4", }, 50 - { .type = "opb", }, 51 - { .type = "ebc", }, 52 - {}, 53 - }; 54 - 55 31 #ifdef CONFIG_PPC_OF_PLATFORM_PCI 56 32 57 33 /* The probing of PCI controllers from of_platform is currently
+13 -1
arch/powerpc/platforms/cell/qpace_setup.c
··· 61 61 printk("*** %04x : %s\n", hex, s ? s : ""); 62 62 } 63 63 64 + static const struct of_device_id qpace_bus_ids[] __initdata = { 65 + { .type = "soc", }, 66 + { .compatible = "soc", }, 67 + { .type = "spider", }, 68 + { .type = "axon", }, 69 + { .type = "plb5", }, 70 + { .type = "plb4", }, 71 + { .type = "opb", }, 72 + { .type = "ebc", }, 73 + {}, 74 + }; 75 + 64 76 static int __init qpace_publish_devices(void) 65 77 { 66 78 int node; 67 79 68 80 /* Publish OF platform devices for southbridge IOs */ 69 - of_platform_bus_probe(NULL, NULL, NULL); 81 + of_platform_bus_probe(NULL, qpace_bus_ids, NULL); 70 82 71 83 /* There is no device for the MIC memory controller, thus we create 72 84 * a platform device for it to attach the EDAC driver to.
+13 -1
arch/powerpc/platforms/cell/setup.c
··· 141 141 return 0; 142 142 } 143 143 144 + static const struct of_device_id cell_bus_ids[] __initdata = { 145 + { .type = "soc", }, 146 + { .compatible = "soc", }, 147 + { .type = "spider", }, 148 + { .type = "axon", }, 149 + { .type = "plb5", }, 150 + { .type = "plb4", }, 151 + { .type = "opb", }, 152 + { .type = "ebc", }, 153 + {}, 154 + }; 155 + 144 156 static int __init cell_publish_devices(void) 145 157 { 146 158 struct device_node *root = of_find_node_by_path("/"); ··· 160 148 int node; 161 149 162 150 /* Publish OF platform devices for southbridge IOs */ 163 - of_platform_bus_probe(NULL, NULL, NULL); 151 + of_platform_bus_probe(NULL, cell_bus_ids, NULL); 164 152 165 153 /* On spider based blades, we need to manually create the OF 166 154 * platform devices for the PCI host bridges
+1 -3
drivers/of/platform.c
··· 701 701 struct platform_device *dev; 702 702 int rc = 0; 703 703 704 - if (matches == NULL) 705 - matches = of_default_bus_ids; 706 - if (matches == OF_NO_DEEP_PROBE) 704 + if (WARN_ON(!matches || matches == OF_NO_DEEP_PROBE)) 707 705 return -EINVAL; 708 706 if (root == NULL) 709 707 root = of_find_node_by_path("/");
-2
include/linux/of_platform.h
··· 19 19 #include <linux/of_device.h> 20 20 #include <linux/platform_device.h> 21 21 22 - extern const struct of_device_id of_default_bus_ids[]; 23 - 24 22 /* 25 23 * An of_platform_driver driver is attached to a basic of_device on 26 24 * the "platform bus" (platform_bus_type).