DeviceTree fixes for 3.14:

- 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
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQEcBAABAgAGBQJS+kY1AAoJEMhvYp4jgsXiEo8IAIHD4+QSyVpHEYnhlyDPPGxt
 zQHj/jadofP7nsC0QgFhTnmG1qEUjl8BZ5UsA+swaixtqFkKdsGtCtQ+c/PCU8LK
 OHTZ2XbT+TTkyKncx+Beghb/v2e8AVGutlSoFGpsGK/nuvda950VoKsH2eVE1X0c
 9YBy209/g+nNcaC+qNwuBL4acy9bQmyj/Pm//5lMzv0VU7uGVE8hl6Eh6kpd847g
 Ww26c/fK0JL3yQBYxbhAupuwXieY6wbZ1u1c/37EloMv6ahsT1v+iFaWJun35KeT
 xyKYgw7tDDcrVEiNfg6jhEYyG2PmDVEvouEafy60ha+iHuQxHp1psrc4zVS9Xn8=
 =bkhj
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2014-02-11 12:37:35 -08:00
commit bbb1955514
4 changed files with 100 additions and 78 deletions

View file

@ -8,6 +8,7 @@ ad Avionic Design GmbH
adi Analog Devices, Inc.
aeroflexgaisler Aeroflex Gaisler AB
ak Asahi Kasei Corp.
allwinner Allwinner Technology Co., Ltd.
altr Altera Corp.
amcc Applied Micro Circuits Corporation (APM, formally AMCC)
amstaos AMS-Taos Inc.
@ -40,6 +41,7 @@ gmt Global Mixed-mode Technology, Inc.
gumstix Gumstix, Inc.
haoyu Haoyu Microelectronic Co. Ltd.
hisilicon Hisilicon Limited.
honeywell Honeywell
hp Hewlett Packard
ibm International Business Machines (IBM)
idt Integrated Device Technologies, Inc.
@ -55,6 +57,7 @@ maxim Maxim Integrated Products
microchip Microchip Technology Inc.
mosaixtech Mosaix Technologies, Inc.
national National Semiconductor
neonode Neonode Inc.
nintendo Nintendo
nvidia NVIDIA
nxp NXP Semiconductors
@ -64,7 +67,7 @@ phytec PHYTEC Messtechnik GmbH
picochip Picochip Ltd
powervr PowerVR (deprecated, use img)
qca Qualcomm Atheros, Inc.
qcom Qualcomm, Inc.
qcom Qualcomm Technologies, Inc
ralink Mediatek/Ralink Technology Corp.
ramtron Ramtron International
realtek Realtek Semiconductor Corp.
@ -78,6 +81,7 @@ silabs Silicon Laboratories
simtek
sirf SiRF Technology, Inc.
snps Synopsys, Inc.
spansion Spansion Inc.
st STMicroelectronics
ste ST-Ericsson
stericsson ST-Ericsson

View file

@ -99,11 +99,12 @@ static unsigned int of_bus_default_get_flags(const __be32 *addr)
static int of_bus_pci_match(struct device_node *np)
{
/*
* "pciex" is PCI Express
* "vci" is for the /chaos bridge on 1st-gen PCI powermacs
* "ht" is hypertransport
*/
return !strcmp(np->type, "pci") || !strcmp(np->type, "vci") ||
!strcmp(np->type, "ht");
return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") ||
!strcmp(np->type, "vci") || !strcmp(np->type, "ht");
}
static void of_bus_pci_count_cells(struct device_node *np,

View file

@ -169,35 +169,15 @@ static inline const char *of_node_full_name(const struct device_node *np)
extern struct device_node *of_find_node_by_name(struct device_node *from,
const char *name);
#define for_each_node_by_name(dn, name) \
for (dn = of_find_node_by_name(NULL, name); dn; \
dn = of_find_node_by_name(dn, name))
extern struct device_node *of_find_node_by_type(struct device_node *from,
const char *type);
#define for_each_node_by_type(dn, type) \
for (dn = of_find_node_by_type(NULL, type); dn; \
dn = of_find_node_by_type(dn, type))
extern struct device_node *of_find_compatible_node(struct device_node *from,
const char *type, const char *compat);
#define for_each_compatible_node(dn, type, compatible) \
for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
dn = of_find_compatible_node(dn, type, compatible))
extern struct device_node *of_find_matching_node_and_match(
struct device_node *from,
const struct of_device_id *matches,
const struct of_device_id **match);
static inline struct device_node *of_find_matching_node(
struct device_node *from,
const struct of_device_id *matches)
{
return of_find_matching_node_and_match(from, matches, NULL);
}
#define for_each_matching_node(dn, matches) \
for (dn = of_find_matching_node(NULL, matches); dn; \
dn = of_find_matching_node(dn, matches))
#define for_each_matching_node_and_match(dn, matches, match) \
for (dn = of_find_matching_node_and_match(NULL, matches, match); \
dn; dn = of_find_matching_node_and_match(dn, matches, match))
extern struct device_node *of_find_node_by_path(const char *path);
extern struct device_node *of_find_node_by_phandle(phandle handle);
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(
extern struct device_node *of_get_child_by_name(const struct device_node *node,
const char *name);
#define for_each_child_of_node(parent, child) \
for (child = of_get_next_child(parent, NULL); child != NULL; \
child = of_get_next_child(parent, child))
#define for_each_available_child_of_node(parent, child) \
for (child = of_get_next_available_child(parent, NULL); child != NULL; \
child = of_get_next_available_child(parent, child))
static inline int of_get_child_count(const struct device_node *np)
{
struct device_node *child;
int num = 0;
for_each_child_of_node(np, child)
num++;
return num;
}
static inline int of_get_available_child_count(const struct device_node *np)
{
struct device_node *child;
int num = 0;
for_each_available_child_of_node(np, child)
num++;
return num;
}
/* cache lookup */
extern struct device_node *of_find_next_cache_node(const struct device_node *);
extern struct device_node *of_find_node_with_property(
struct device_node *from, const char *prop_name);
#define for_each_node_with_property(dn, prop_name) \
for (dn = of_find_node_with_property(NULL, prop_name); dn; \
dn = of_find_node_with_property(dn, prop_name))
extern struct property *of_find_property(const struct device_node *np,
const char *name,
@ -367,27 +315,48 @@ static inline struct device_node *of_find_node_by_name(struct device_node *from,
return NULL;
}
static inline struct device_node *of_find_node_by_type(struct device_node *from,
const char *type)
{
return NULL;
}
static inline struct device_node *of_find_matching_node_and_match(
struct device_node *from,
const struct of_device_id *matches,
const struct of_device_id **match)
{
return NULL;
}
static inline struct device_node *of_get_parent(const struct device_node *node)
{
return NULL;
}
static inline struct device_node *of_get_next_child(
const struct device_node *node, struct device_node *prev)
{
return NULL;
}
static inline struct device_node *of_get_next_available_child(
const struct device_node *node, struct device_node *prev)
{
return NULL;
}
static inline struct device_node *of_find_node_with_property(
struct device_node *from, const char *prop_name)
{
return NULL;
}
static inline bool of_have_populated_dt(void)
{
return false;
}
/* Kill an unused variable warning on a device_node pointer */
static inline void __of_use_dn(const struct device_node *np)
{
}
#define for_each_child_of_node(parent, child) \
while (__of_use_dn(parent), __of_use_dn(child), 0)
#define for_each_available_child_of_node(parent, child) \
while (0)
static inline struct device_node *of_get_child_by_name(
const struct device_node *node,
const char *name)
@ -395,16 +364,6 @@ static inline struct device_node *of_get_child_by_name(
return NULL;
}
static inline int of_get_child_count(const struct device_node *np)
{
return 0;
}
static inline int of_get_available_child_count(const struct device_node *np)
{
return 0;
}
static inline int of_device_is_compatible(const struct device_node *device,
const char *name)
{
@ -569,6 +528,13 @@ extern int of_node_to_nid(struct device_node *np);
static inline int of_node_to_nid(struct device_node *device) { return 0; }
#endif
static inline struct device_node *of_find_matching_node(
struct device_node *from,
const struct of_device_id *matches)
{
return of_find_matching_node_and_match(from, matches, NULL);
}
/**
* of_property_read_bool - Findfrom a property
* @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,
s; \
s = of_prop_next_string(prop, s))
#define for_each_node_by_name(dn, name) \
for (dn = of_find_node_by_name(NULL, name); dn; \
dn = of_find_node_by_name(dn, name))
#define for_each_node_by_type(dn, type) \
for (dn = of_find_node_by_type(NULL, type); dn; \
dn = of_find_node_by_type(dn, type))
#define for_each_compatible_node(dn, type, compatible) \
for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
dn = of_find_compatible_node(dn, type, compatible))
#define for_each_matching_node(dn, matches) \
for (dn = of_find_matching_node(NULL, matches); dn; \
dn = of_find_matching_node(dn, matches))
#define for_each_matching_node_and_match(dn, matches, match) \
for (dn = of_find_matching_node_and_match(NULL, matches, match); \
dn; dn = of_find_matching_node_and_match(dn, matches, match))
#define for_each_child_of_node(parent, child) \
for (child = of_get_next_child(parent, NULL); child != NULL; \
child = of_get_next_child(parent, child))
#define for_each_available_child_of_node(parent, child) \
for (child = of_get_next_available_child(parent, NULL); child != NULL; \
child = of_get_next_available_child(parent, child))
#define for_each_node_with_property(dn, prop_name) \
for (dn = of_find_node_with_property(NULL, prop_name); dn; \
dn = of_find_node_with_property(dn, prop_name))
static inline int of_get_child_count(const struct device_node *np)
{
struct device_node *child;
int num = 0;
for_each_child_of_node(np, child)
num++;
return num;
}
static inline int of_get_available_child_count(const struct device_node *np)
{
struct device_node *child;
int num = 0;
for_each_available_child_of_node(np, child)
num++;
return num;
}
#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE)
extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);

View file

@ -78,11 +78,13 @@ static inline int of_device_uevent_modalias(struct device *dev,
static inline void of_device_node_put(struct device *dev) { }
static inline const struct of_device_id *of_match_device(
static inline const struct of_device_id *__of_match_device(
const struct of_device_id *matches, const struct device *dev)
{
return NULL;
}
#define of_match_device(matches, dev) \
__of_match_device(of_match_ptr(matches), (dev))
static inline struct device_node *of_cpu_device_node_get(int cpu)
{