summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-01-11 13:11:06 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-01-11 13:11:06 +0100
commitb9a2512aaa22086dc84db3f55a0d912b206c11e3 (patch)
tree38cfaccf38003f10032808354fce63d1b369c9e2 /include
parentb1ebbe76eb48b56ccd804636edcb5fb0b49da98a (diff)
parent0295088d53cd605aaf2a2accfd65c19c0f8a0cf0 (diff)
downloadbarebox-b9a2512aaa22086dc84db3f55a0d912b206c11e3.tar.gz
barebox-b9a2512aaa22086dc84db3f55a0d912b206c11e3.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'include')
-rw-r--r--include/bootstrap.h8
-rw-r--r--include/driver.h5
-rw-r--r--include/of.h19
3 files changed, 26 insertions, 6 deletions
diff --git a/include/bootstrap.h b/include/bootstrap.h
index 9863ff425e..d3ee6be47c 100644
--- a/include/bootstrap.h
+++ b/include/bootstrap.h
@@ -15,10 +15,10 @@ typedef void (*kernel_entry_func)(int zero, int arch, void *params);
void bootstrap_boot(kernel_entry_func func, bool barebox);
#ifdef CONFIG_BOOTSTRAP_DEVFS
-void* bootstrap_read_devfs(char *devname, bool use_bb, int offset,
+void* bootstrap_read_devfs(const char *devname, bool use_bb, int offset,
int default_size, int max_size);
#else
-static inline void* bootstrap_read_devfs(char *devname, bool use_bb, int offset,
+static inline void* bootstrap_read_devfs(const char *devname, bool use_bb, int offset,
int default_size, int max_size)
{
return NULL;
@@ -26,9 +26,9 @@ static inline void* bootstrap_read_devfs(char *devname, bool use_bb, int offset,
#endif
#ifdef CONFIG_BOOTSTRAP_DISK
-void* bootstrap_read_disk(char *devname, char *fstype);
+void* bootstrap_read_disk(const char *devname, const char *fstype);
#else
-static inline void* bootstrap_read_disk(char *devname, char *fstype)
+static inline void* bootstrap_read_disk(const char *devname, const char *fstype)
{
return NULL;
}
diff --git a/include/driver.h b/include/driver.h
index 046dd9079d..31c673452f 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -450,13 +450,18 @@ struct cdev {
int open;
struct mtd_info *mtd;
u8 dos_partition_type;
+ struct cdev *link;
+ struct list_head link_entry, links;
};
int devfs_create(struct cdev *);
+int devfs_create_link(struct cdev *, const char *name);
int devfs_remove(struct cdev *);
int cdev_find_free_index(const char *);
struct cdev *device_find_partition(struct device_d *dev, const char *name);
struct cdev *cdev_by_name(const char *filename);
+struct cdev *lcdev_by_name(const char *filename);
+struct cdev *cdev_readlink(struct cdev *cdev);
struct cdev *cdev_by_device_node(struct device_node *node);
struct cdev *cdev_open(const char *name, unsigned long flags);
int cdev_do_open(struct cdev *, unsigned long flags);
diff --git a/include/of.h b/include/of.h
index e60fe89825..75cc3c11c1 100644
--- a/include/of.h
+++ b/include/of.h
@@ -641,9 +641,13 @@ static inline struct device_node *of_find_node_by_path_or_alias(
#define for_each_node_by_name_from(dn, root, name) \
for (dn = of_find_node_by_name(root, name); dn; \
dn = of_find_node_by_name(dn, name))
-#define for_each_compatible_node(dn, type, compatible) \
- for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
+/* Iterate over compatible nodes starting from given root */
+#define for_each_compatible_node_from(dn, root, type, compatible) \
+ for (dn = of_find_compatible_node(root, type, compatible); dn; \
dn = of_find_compatible_node(dn, type, compatible))
+/* Iterate over compatible nodes in default device tree */
+#define for_each_compatible_node(dn, type, compatible) \
+ for_each_compatible_node_from(dn, NULL, type, compatible)
static inline struct device_node *of_find_matching_node(
struct device_node *from,
const struct of_device_id *matches)
@@ -732,6 +736,17 @@ static inline int of_property_read_u32(const struct device_node *np,
s; \
s = of_prop_next_string(prop, s))
+/*
+ * struct device_node *n;
+ *
+ * of_property_for_each_phandle(np, root, "propname", n)
+ * printk("phandle points to: %s\n", n->full_name);
+ */
+#define of_property_for_each_phandle(np, root, propname, n) \
+ for (int _i = 0; \
+ (n = of_parse_phandle_from(np, root, propname, _i));\
+ _i++)
+
static inline int of_property_write_u8(struct device_node *np,
const char *propname, u8 value)
{