Skip to content

Commit bbb1955

Browse files
committed
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
2 parents 738b52b + 860a445 commit bbb1955

File tree

4 files changed

+95
-73
lines changed

4 files changed

+95
-73
lines changed

Documentation/devicetree/bindings/vendor-prefixes.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ad Avionic Design GmbH
88
adi Analog Devices, Inc.
99
aeroflexgaisler Aeroflex Gaisler AB
1010
ak Asahi Kasei Corp.
11+
allwinner Allwinner Technology Co., Ltd.
1112
altr Altera Corp.
1213
amcc Applied Micro Circuits Corporation (APM, formally AMCC)
1314
amstaos AMS-Taos Inc.
@@ -40,6 +41,7 @@ gmt Global Mixed-mode Technology, Inc.
4041
gumstix Gumstix, Inc.
4142
haoyu Haoyu Microelectronic Co. Ltd.
4243
hisilicon Hisilicon Limited.
44+
honeywell Honeywell
4345
hp Hewlett Packard
4446
ibm International Business Machines (IBM)
4547
idt Integrated Device Technologies, Inc.
@@ -55,6 +57,7 @@ maxim Maxim Integrated Products
5557
microchip Microchip Technology Inc.
5658
mosaixtech Mosaix Technologies, Inc.
5759
national National Semiconductor
60+
neonode Neonode Inc.
5861
nintendo Nintendo
5962
nvidia NVIDIA
6063
nxp NXP Semiconductors
@@ -64,7 +67,7 @@ phytec PHYTEC Messtechnik GmbH
6467
picochip Picochip Ltd
6568
powervr PowerVR (deprecated, use img)
6669
qca Qualcomm Atheros, Inc.
67-
qcom Qualcomm, Inc.
70+
qcom Qualcomm Technologies, Inc
6871
ralink Mediatek/Ralink Technology Corp.
6972
ramtron Ramtron International
7073
realtek Realtek Semiconductor Corp.
@@ -78,6 +81,7 @@ silabs Silicon Laboratories
7881
simtek
7982
sirf SiRF Technology, Inc.
8083
snps Synopsys, Inc.
84+
spansion Spansion Inc.
8185
st STMicroelectronics
8286
ste ST-Ericsson
8387
stericsson ST-Ericsson

drivers/of/address.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ static unsigned int of_bus_default_get_flags(const __be32 *addr)
9999
static int of_bus_pci_match(struct device_node *np)
100100
{
101101
/*
102+
* "pciex" is PCI Express
102103
* "vci" is for the /chaos bridge on 1st-gen PCI powermacs
103104
* "ht" is hypertransport
104105
*/
105-
return !strcmp(np->type, "pci") || !strcmp(np->type, "vci") ||
106-
!strcmp(np->type, "ht");
106+
return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") ||
107+
!strcmp(np->type, "vci") || !strcmp(np->type, "ht");
107108
}
108109

109110
static void of_bus_pci_count_cells(struct device_node *np,

include/linux/of.h

Lines changed: 84 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -169,35 +169,15 @@ static inline const char *of_node_full_name(const struct device_node *np)
169169

170170
extern struct device_node *of_find_node_by_name(struct device_node *from,
171171
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))
175172
extern struct device_node *of_find_node_by_type(struct device_node *from,
176173
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))
180174
extern struct device_node *of_find_compatible_node(struct device_node *from,
181175
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))
185176
extern struct device_node *of_find_matching_node_and_match(
186177
struct device_node *from,
187178
const struct of_device_id *matches,
188179
const struct of_device_id **match);
189-
static inline struct device_node *of_find_matching_node(
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))
180+
201181
extern struct device_node *of_find_node_by_path(const char *path);
202182
extern struct device_node *of_find_node_by_phandle(phandle handle);
203183
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(
209189

210190
extern struct device_node *of_get_child_by_name(const struct device_node *node,
211191
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-
}
241192

242193
/* cache lookup */
243194
extern struct device_node *of_find_next_cache_node(const struct device_node *);
244195
extern struct device_node *of_find_node_with_property(
245196
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))
249197

250198
extern struct property *of_find_property(const struct device_node *np,
251199
const char *name,
@@ -367,42 +315,53 @@ static inline struct device_node *of_find_node_by_name(struct device_node *from,
367315
return NULL;
368316
}
369317

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)
371320
{
372321
return NULL;
373322
}
374323

375-
static inline bool of_have_populated_dt(void)
324+
static inline struct device_node *of_find_matching_node_and_match(
325+
struct device_node *from,
326+
const struct of_device_id *matches,
327+
const struct of_device_id **match)
376328
{
377-
return false;
329+
return NULL;
378330
}
379331

380-
/* Kill an unused variable warning on a device_node pointer */
381-
static inline void __of_use_dn(const struct device_node *np)
332+
static inline struct device_node *of_get_parent(const struct device_node *node)
382333
{
334+
return NULL;
383335
}
384336

385-
#define for_each_child_of_node(parent, child) \
386-
while (__of_use_dn(parent), __of_use_dn(child), 0)
337+
static inline struct device_node *of_get_next_child(
338+
const struct device_node *node, struct device_node *prev)
339+
{
340+
return NULL;
341+
}
387342

388-
#define for_each_available_child_of_node(parent, child) \
389-
while (0)
343+
static inline struct device_node *of_get_next_available_child(
344+
const struct device_node *node, struct device_node *prev)
345+
{
346+
return NULL;
347+
}
390348

391-
static inline struct device_node *of_get_child_by_name(
392-
const struct device_node *node,
393-
const char *name)
349+
static inline struct device_node *of_find_node_with_property(
350+
struct device_node *from, const char *prop_name)
394351
{
395352
return NULL;
396353
}
397354

398-
static inline int of_get_child_count(const struct device_node *np)
355+
static inline bool of_have_populated_dt(void)
399356
{
400-
return 0;
357+
return false;
401358
}
402359

403-
static inline int of_get_available_child_count(const struct device_node *np)
360+
static inline struct device_node *of_get_child_by_name(
361+
const struct device_node *node,
362+
const char *name)
404363
{
405-
return 0;
364+
return NULL;
406365
}
407366

408367
static inline int of_device_is_compatible(const struct device_node *device,
@@ -569,6 +528,13 @@ extern int of_node_to_nid(struct device_node *np);
569528
static inline int of_node_to_nid(struct device_node *device) { return 0; }
570529
#endif
571530

531+
static inline struct device_node *of_find_matching_node(
532+
struct device_node *from,
533+
const struct of_device_id *matches)
534+
{
535+
return of_find_matching_node_and_match(from, matches, NULL);
536+
}
537+
572538
/**
573539
* of_property_read_bool - Findfrom a property
574540
* @np: device node from which the property value is to be read.
@@ -618,6 +584,55 @@ static inline int of_property_read_u32(const struct device_node *np,
618584
s; \
619585
s = of_prop_next_string(prop, s))
620586

587+
#define for_each_node_by_name(dn, name) \
588+
for (dn = of_find_node_by_name(NULL, name); dn; \
589+
dn = of_find_node_by_name(dn, name))
590+
#define for_each_node_by_type(dn, type) \
591+
for (dn = of_find_node_by_type(NULL, type); dn; \
592+
dn = of_find_node_by_type(dn, type))
593+
#define for_each_compatible_node(dn, type, compatible) \
594+
for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
595+
dn = of_find_compatible_node(dn, type, compatible))
596+
#define for_each_matching_node(dn, matches) \
597+
for (dn = of_find_matching_node(NULL, matches); dn; \
598+
dn = of_find_matching_node(dn, matches))
599+
#define for_each_matching_node_and_match(dn, matches, match) \
600+
for (dn = of_find_matching_node_and_match(NULL, matches, match); \
601+
dn; dn = of_find_matching_node_and_match(dn, matches, match))
602+
603+
#define for_each_child_of_node(parent, child) \
604+
for (child = of_get_next_child(parent, NULL); child != NULL; \
605+
child = of_get_next_child(parent, child))
606+
#define for_each_available_child_of_node(parent, child) \
607+
for (child = of_get_next_available_child(parent, NULL); child != NULL; \
608+
child = of_get_next_available_child(parent, child))
609+
610+
#define for_each_node_with_property(dn, prop_name) \
611+
for (dn = of_find_node_with_property(NULL, prop_name); dn; \
612+
dn = of_find_node_with_property(dn, prop_name))
613+
614+
static inline int of_get_child_count(const struct device_node *np)
615+
{
616+
struct device_node *child;
617+
int num = 0;
618+
619+
for_each_child_of_node(np, child)
620+
num++;
621+
622+
return num;
623+
}
624+
625+
static inline int of_get_available_child_count(const struct device_node *np)
626+
{
627+
struct device_node *child;
628+
int num = 0;
629+
630+
for_each_available_child_of_node(np, child)
631+
num++;
632+
633+
return num;
634+
}
635+
621636
#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE)
622637
extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
623638
extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);

include/linux/of_device.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ static inline int of_device_uevent_modalias(struct device *dev,
7878

7979
static inline void of_device_node_put(struct device *dev) { }
8080

81-
static inline const struct of_device_id *of_match_device(
81+
static inline const struct of_device_id *__of_match_device(
8282
const struct of_device_id *matches, const struct device *dev)
8383
{
8484
return NULL;
8585
}
86+
#define of_match_device(matches, dev) \
87+
__of_match_device(of_match_ptr(matches), (dev))
8688

8789
static inline struct device_node *of_cpu_device_node_get(int cpu)
8890
{

0 commit comments

Comments
 (0)