summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-07 10:37:54 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-07 10:37:54 -0700
commitdd6ec12f3bf83ca3c4e712a9f35960aec779f6f9 (patch)
tree8b6f9f187eb0ae621a64798270c420143c698484 /include
parent21c19bc7ee256094aba74af8d91a824da4bc36af (diff)
parenta4485b545e2fad4d65732cb7c60089bf4246de5c (diff)
Merge tag 'devicetree-for-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree updates from Rob Herring: - vsprintf format specifier %pOF for device_node's. This will enable us to stop storing the full node names. Conversion of users will happen next cycle. - Update documentation to point to DT specification instead of ePAPR. - Split out graph and property functions to a separate file. - New of-graph functions for ALSA - Add vendor prefixes for RISC-V, Linksys, iWave Systems, Roofull, Itead, and BananaPi. - Improve dtx_diff utility filename printing. * tag 'devicetree-for-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (32 commits) of: document /sys/firmware/fdt dt-bindings: Add RISC-V vendor prefix vsprintf: Add %p extension "%pOF" for device tree of: find_node_by_full_name rewrite to compare each level of: use kbasename instead of open coding dt-bindings: thermal: add file extension to brcm,ns-thermal of: update ePAPR references to point to Devicetree Specification scripts/dtc: dtx_diff - Show real file names in diff header of: detect invalid phandle in overlay of: be consistent in form of file mode of: make __of_attach_node() static of: address.c header comment typo of: fdt.c header comment typo of: make of_fdt_is_compatible() static dt-bindings: display-timing.txt convert non-ascii characters to ascii Documentation: remove overlay-notes reference to non-existent file dt-bindings: usb: exynos-usb: Add missing required VDD properties dt-bindings: Add vendor prefix for Linksys MAINTAINERS: add device tree ABI documentation file of: Add vendor prefix for iWave Systems Technologies Pvt. Ltd ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/of.h36
-rw-r--r--include/linux/of_fdt.h3
2 files changed, 26 insertions, 13 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index 50fcdb54087f..fa089a2789a0 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -148,18 +148,28 @@ extern raw_spinlock_t devtree_lock;
#ifdef CONFIG_OF
void of_core_init(void);
-static inline bool is_of_node(struct fwnode_handle *fwnode)
+static inline bool is_of_node(const struct fwnode_handle *fwnode)
{
return !IS_ERR_OR_NULL(fwnode) && fwnode->type == FWNODE_OF;
}
-static inline struct device_node *to_of_node(struct fwnode_handle *fwnode)
-{
- return is_of_node(fwnode) ?
- container_of(fwnode, struct device_node, fwnode) : NULL;
-}
-
-#define of_fwnode_handle(node) (&(node)->fwnode)
+#define to_of_node(__fwnode) \
+ ({ \
+ typeof(__fwnode) __to_of_node_fwnode = (__fwnode); \
+ \
+ is_of_node(__to_of_node_fwnode) ? \
+ container_of(__to_of_node_fwnode, \
+ struct device_node, fwnode) : \
+ NULL; \
+ })
+
+#define of_fwnode_handle(node) \
+ ({ \
+ typeof(node) __of_fwnode_handle_node = (node); \
+ \
+ __of_fwnode_handle_node ? \
+ &__of_fwnode_handle_node->fwnode : NULL; \
+ })
static inline bool of_have_populated_dt(void)
{
@@ -533,12 +543,12 @@ static inline void of_core_init(void)
{
}
-static inline bool is_of_node(struct fwnode_handle *fwnode)
+static inline bool is_of_node(const struct fwnode_handle *fwnode)
{
return false;
}
-static inline struct device_node *to_of_node(struct fwnode_handle *fwnode)
+static inline struct device_node *to_of_node(const struct fwnode_handle *fwnode)
{
return NULL;
}
@@ -627,6 +637,12 @@ static inline int of_device_is_compatible(const struct device_node *device,
return 0;
}
+static inline int of_device_compatible_match(struct device_node *device,
+ const char *const *compat)
+{
+ return 0;
+}
+
static inline bool of_device_is_available(const struct device_node *device)
{
return false;
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 1dfbfd0d8040..013c5418aeec 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -31,9 +31,6 @@ extern void *of_fdt_get_property(const void *blob,
unsigned long node,
const char *name,
int *size);
-extern int of_fdt_is_compatible(const void *blob,
- unsigned long node,
- const char *compat);
extern bool of_fdt_is_big_endian(const void *blob,
unsigned long node);
extern int of_fdt_match(const void *blob, unsigned long node,