summaryrefslogtreecommitdiffstats
path: root/include/driver.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-04-09 15:16:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-09-01 07:43:16 +0200
commit3f68a7698d882f1e1ce5827fac92736e19f76018 (patch)
tree4322b285f393124fefc5729780ce14dbbbf0a95c /include/driver.h
parent89ca3fcaad55a3847d1a6c576dedfcc9f7394e31 (diff)
downloadbarebox-3f68a7698d882f1e1ce5827fac92736e19f76018.tar.gz
barebox-3f68a7698d882f1e1ce5827fac92736e19f76018.tar.xz
cdev: Add function to find cdev by device_node
This adds a device_node member to struct cdev and a function to find a cdev by device_node. This also removes the setting of cdev->dev->device_node in the of partition parser. We must not set the device since it may not refer to a partition but to a whole device with partitions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/driver.h')
-rw-r--r--include/driver.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h
index 728f8abb49..046dd9079d 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -436,6 +436,7 @@ struct cdev {
struct file_operations *ops;
void *priv;
struct device_d *dev;
+ struct device_node *device_node;
struct list_head list;
struct list_head devices_list;
char *name; /* filename under /dev/ */
@@ -456,6 +457,7 @@ 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 *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);
void cdev_close(struct cdev *cdev);