diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-11 15:37:35 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-02-11 15:37:35 -0500 |
| commit | bbb1955514877182e8d20a5f62c7f8c9fd330ec7 (patch) | |
| tree | 6c68d44122e8966ba5cd246e9379bc6998277648 | |
| parent | 738b52bb9845da183b6ff46a8f685b56a63379d1 (diff) | |
| parent | 860a445c25aa2f99aa5881603a1f4ed2cec64025 (diff) | |
Merge tag 'dt-fixes-for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree fixes from Rob Herring:
- Fix compile error drivers/spi/spi-rspi.c with !CONFIG_OF
- Fix warnings for unused/uninitialized variables with !CONFIG_OF
- Fix PCIe bus matching for powerpc
- Add documentation for various vendor strings
* tag 'dt-fixes-for-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
DT: Add vendor prefix for Spansion Inc.
of/device: Nullify match table in of_match_device() for CONFIG_OF=n
dt-bindings: add vendor-prefix for neonode
of: fix PCI bus match for PCIe slots
of: restructure for_each macros to fix compile warnings
of: add vendor prefix for Honeywell
of: Update qcom vendor prefix description
of: add vendor prefix for Allwinner Technology
| -rw-r--r-- | Documentation/devicetree/bindings/vendor-prefixes.txt | 6 | ||||
| -rw-r--r-- | drivers/of/address.c | 5 | ||||
| -rw-r--r-- | include/linux/of.h | 153 | ||||
| -rw-r--r-- | include/linux/of_device.h | 4 |
4 files changed, 95 insertions, 73 deletions
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index 3f900cd51bf0..40ce2df0e0e9 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt | |||
| @@ -8,6 +8,7 @@ ad Avionic Design GmbH | |||
| 8 | adi Analog Devices, Inc. | 8 | adi Analog Devices, Inc. |
| 9 | aeroflexgaisler Aeroflex Gaisler AB | 9 | aeroflexgaisler Aeroflex Gaisler AB |
| 10 | ak Asahi Kasei Corp. | 10 | ak Asahi Kasei Corp. |
| 11 | allwinner Allwinner Technology Co., Ltd. | ||
| 11 | altr Altera Corp. | 12 | altr Altera Corp. |
| 12 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) | 13 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) |
| 13 | amstaos AMS-Taos Inc. | 14 | amstaos AMS-Taos Inc. |
| @@ -40,6 +41,7 @@ gmt Global Mixed-mode Technology, Inc. | |||
| 40 | gumstix Gumstix, Inc. | 41 | gumstix Gumstix, Inc. |
| 41 | haoyu Haoyu Microelectronic Co. Ltd. | 42 | haoyu Haoyu Microelectronic Co. Ltd. |
| 42 | hisilicon Hisilicon Limited. | 43 | hisilicon Hisilicon Limited. |
| 44 | honeywell Honeywell | ||
| 43 | hp Hewlett Packard | 45 | hp Hewlett Packard |
| 44 | ibm International Business Machines (IBM) | 46 | ibm International Business Machines (IBM) |
| 45 | idt Integrated Device Technologies, Inc. | 47 | idt Integrated Device Technologies, Inc. |
| @@ -55,6 +57,7 @@ maxim Maxim Integrated Products | |||
| 55 | microchip Microchip Technology Inc. | 57 | microchip Microchip Technology Inc. |
| 56 | mosaixtech Mosaix Technologies, Inc. | 58 | mosaixtech Mosaix Technologies, Inc. |
| 57 | national National Semiconductor | 59 | national National Semiconductor |
| 60 | neonode Neonode Inc. | ||
| 58 | nintendo Nintendo | 61 | nintendo Nintendo |
| 59 | nvidia NVIDIA | 62 | nvidia NVIDIA |
| 60 | nxp NXP Semiconductors | 63 | nxp NXP Semiconductors |
| @@ -64,7 +67,7 @@ phytec PHYTEC Messtechnik GmbH | |||
| 64 | picochip Picochip Ltd | 67 | picochip Picochip Ltd |
| 65 | powervr PowerVR (deprecated, use img) | 68 | powervr PowerVR (deprecated, use img) |
| 66 | qca Qualcomm Atheros, Inc. | 69 | qca Qualcomm Atheros, Inc. |
| 67 | qcom Qualcomm, Inc. | 70 | qcom Qualcomm Technologies, Inc |
| 68 | ralink Mediatek/Ralink Technology Corp. | 71 | ralink Mediatek/Ralink Technology Corp. |
| 69 | ramtron Ramtron International | 72 | ramtron Ramtron International |
| 70 | realtek Realtek Semiconductor Corp. | 73 | realtek Realtek Semiconductor Corp. |
| @@ -78,6 +81,7 @@ silabs Silicon Laboratories | |||
| 78 | simtek | 81 | simtek |
| 79 | sirf SiRF Technology, Inc. | 82 | sirf SiRF Technology, Inc. |
| 80 | snps Synopsys, Inc. | 83 | snps Synopsys, Inc. |
| 84 | spansion Spansion Inc. | ||
| 81 | st STMicroelectronics | 85 | st STMicroelectronics |
| 82 | ste ST-Ericsson | 86 | ste ST-Ericsson |
| 83 | stericsson ST-Ericsson | 87 | stericsson ST-Ericsson |
diff --git a/drivers/of/address.c b/drivers/of/address.c index d3dd41c840f1..1a54f1ffaadb 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c | |||
| @@ -99,11 +99,12 @@ static unsigned int of_bus_default_get_flags(const __be32 *addr) | |||
| 99 | static int of_bus_pci_match(struct device_node *np) | 99 | static int of_bus_pci_match(struct device_node *np) |
| 100 | { | 100 | { |
| 101 | /* | 101 | /* |
| 102 | * "pciex" is PCI Express | ||
| 102 | * "vci" is for the /chaos bridge on 1st-gen PCI powermacs | 103 | * "vci" is for the /chaos bridge on 1st-gen PCI powermacs |
| 103 | * "ht" is hypertransport | 104 | * "ht" is hypertransport |
| 104 | */ | 105 | */ |
| 105 | return !strcmp(np->type, "pci") || !strcmp(np->type, "vci") || | 106 | return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") || |
| 106 | !strcmp(np->type, "ht"); | 107 | !strcmp(np->type, "vci") || !strcmp(np->type, "ht"); |
| 107 | } | 108 | } |
| 108 | 109 | ||
| 109 | static void of_bus_pci_count_cells(struct device_node *np, | 110 | static void of_bus_pci_count_cells(struct device_node *np, |
diff --git a/include/linux/of.h b/include/linux/of.h index 70c64ba17fa5..435cb995904d 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -169,35 +169,15 @@ static inline const char *of_node_full_name(const struct device_node *np) | |||
| 169 | 169 | ||
| 170 | extern struct device_node *of_find_node_by_name(struct device_node *from, | 170 | extern struct device_node *of_find_node_by_name(struct device_node *from, |
| 171 | const char *name); | 171 | const char *name); |
| 172 | #define for_each_node_by_name(dn, name) \ | ||
| 173 | for (dn = of_find_node_by_name(NULL, name); dn; \ | ||
| 174 | dn = of_find_node_by_name(dn, name)) | ||
| 175 | extern struct device_node *of_find_node_by_type(struct device_node *from, | 172 | extern struct device_node *of_find_node_by_type(struct device_node *from, |
| 176 | const char *type); | 173 | const char *type); |
| 177 | #define for_each_node_by_type(dn, type) \ | ||
| 178 | for (dn = of_find_node_by_type(NULL, type); dn; \ | ||
| 179 | dn = of_find_node_by_type(dn, type)) | ||
| 180 | extern struct device_node *of_find_compatible_node(struct device_node *from, | 174 | extern struct device_node *of_find_compatible_node(struct device_node *from, |
| 181 | const char *type, const char *compat); | 175 | const char *type, const char *compat); |
| 182 | #define for_each_compatible_node(dn, type, compatible) \ | ||
| 183 | for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ | ||
| 184 | dn = of_find_compatible_node(dn, type, compatible)) | ||
| 185 | extern struct device_node *of_find_matching_node_and_match( | 176 | extern struct device_node *of_find_matching_node_and_match( |
| 186 | struct device_node *from, | 177 | struct device_node *from, |
| 187 | const struct of_device_id *matches, | 178 | const struct of_device_id *matches, |
| 188 | const struct of_device_id **match); | 179 | const struct of_device_id **match); |
| 189 | static inline struct device_node *of_find_matching_node( | 180 | |
| 190 | struct device_node *from, | ||
| 191 | const struct of_device_id *matches) | ||
| 192 | { | ||
| 193 | return of_find_matching_node_and_match(from, matches, NULL); | ||
| 194 | } | ||
| 195 | #define for_each_matching_node(dn, matches) \ | ||
| 196 | for (dn = of_find_matching_node(NULL, matches); dn; \ | ||
| 197 | dn = of_find_matching_node(dn, matches)) | ||
| 198 | #define for_each_matching_node_and_match(dn, matches, match) \ | ||
| 199 | for (dn = of_find_matching_node_and_match(NULL, matches, match); \ | ||
| 200 | dn; dn = of_find_matching_node_and_match(dn, matches, match)) | ||
| 201 | extern struct device_node *of_find_node_by_path(const char *path); | 181 | extern struct device_node *of_find_node_by_path(const char *path); |
| 202 | extern struct device_node *of_find_node_by_phandle(phandle handle); | 182 | extern struct device_node *of_find_node_by_phandle(phandle handle); |
| 203 | extern struct device_node *of_get_parent(const struct device_node *node); | 183 | extern struct device_node *of_get_parent(const struct device_node *node); |
| @@ -209,43 +189,11 @@ extern struct device_node *of_get_next_available_child( | |||
| 209 | 189 | ||
| 210 | extern struct device_node *of_get_child_by_name(const struct device_node *node, | 190 | extern struct device_node *of_get_child_by_name(const struct device_node *node, |
| 211 | const char *name); | 191 | const char *name); |
| 212 | #define for_each_child_of_node(parent, child) \ | ||
| 213 | for (child = of_get_next_child(parent, NULL); child != NULL; \ | ||
| 214 | child = of_get_next_child(parent, child)) | ||
| 215 | |||
| 216 | #define for_each_available_child_of_node(parent, child) \ | ||
| 217 | for (child = of_get_next_available_child(parent, NULL); child != NULL; \ | ||
| 218 | child = of_get_next_available_child(parent, child)) | ||
| 219 | |||
| 220 | static inline int of_get_child_count(const struct device_node *np) | ||
| 221 | { | ||
| 222 | struct device_node *child; | ||
| 223 | int num = 0; | ||
| 224 | |||
| 225 | for_each_child_of_node(np, child) | ||
| 226 | num++; | ||
| 227 | |||
| 228 | return num; | ||
| 229 | } | ||
| 230 | |||
| 231 | static inline int of_get_available_child_count(const struct device_node *np) | ||
| 232 | { | ||
| 233 | struct device_node *child; | ||
| 234 | int num = 0; | ||
| 235 | |||
| 236 | for_each_available_child_of_node(np, child) | ||
| 237 | num++; | ||
| 238 | |||
| 239 | return num; | ||
| 240 | } | ||
| 241 | 192 | ||
| 242 | /* cache lookup */ | 193 | /* cache lookup */ |
| 243 | extern struct device_node *of_find_next_cache_node(const struct device_node *); | 194 | extern struct device_node *of_find_next_cache_node(const struct device_node *); |
| 244 | extern struct device_node *of_find_node_with_property( | 195 | extern struct device_node *of_find_node_with_property( |
| 245 | struct device_node *from, const char *prop_name); | 196 | struct device_node *from, const char *prop_name); |
| 246 | #define for_each_node_with_property(dn, prop_name) \ | ||
| 247 | for (dn = of_find_node_with_property(NULL, prop_name); dn; \ | ||
| 248 | dn = of_find_node_with_property(dn, prop_name)) | ||
| 249 | 197 | ||
| 250 | extern struct property *of_find_property(const struct device_node *np, | 198 | extern struct property *of_find_property(const struct device_node *np, |
| 251 | const char *name, | 199 | const char *name, |
| @@ -367,42 +315,53 @@ static inline struct device_node *of_find_node_by_name(struct device_node *from, | |||
| 367 | return NULL; | 315 | return NULL; |
| 368 | } | 316 | } |
| 369 | 317 | ||
| 370 | static inline struct device_node *of_get_parent(const struct device_node *node) | 318 | static inline struct device_node *of_find_node_by_type(struct device_node *from, |
| 319 | const char *type) | ||
| 371 | { | 320 | { |
| 372 | return NULL; | 321 | return NULL; |
