diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2009-06-11 15:33:49 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-07-21 16:41:47 +0200 |
commit | 02ba8a0542f119e02e63a3b4cd6ae5abfd8331f3 (patch) | |
tree | c358a8c1f4d1cc5db91d898e6f409f55b22f4127 /include/driver.h | |
parent | 2f8df2a003a22e8b7397e51ac5f1796db920d579 (diff) | |
download | barebox-02ba8a0542f119e02e63a3b4cd6ae5abfd8331f3.tar.gz barebox-02ba8a0542f119e02e63a3b4cd6ae5abfd8331f3.tar.xz |
get rid of device ids
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/driver.h')
-rw-r--r-- | include/driver.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/driver.h b/include/driver.h index 80045183b7..68f744a942 100644 --- a/include/driver.h +++ b/include/driver.h @@ -67,7 +67,7 @@ struct device_d { /*! The id is used to uniquely identify a device in the system. The id * will show up under /dev/ as the device's name. Usually this is * something like eth0 or nor0. */ - char id[MAX_DRIVER_NAME]; + int id; /*! FIXME */ unsigned long size; @@ -99,6 +99,8 @@ struct device_d { /*! The parameters for this device. This is used to carry information * of board specific data from the board code to the device driver. */ struct param_d *param; + + struct list_head cdevs; }; /** @brief Describes a driver present in the system */ @@ -165,13 +167,13 @@ int dev_add_child(struct device_d *dev, struct device_d *child); */ struct device_d *get_device_by_type(ulong type, struct device_d *last); struct device_d *get_device_by_id(const char *id); -struct device_d *get_device_by_path(const char *path); +struct device_d *get_device_by_name(const char *name); /* Find a free device id from the given template. This is archieved by * appending a number to the template. Dynamically created devices should * use this function rather than filling the id field themselves. */ -int get_free_deviceid(char *id, const char *id_template); +int get_free_deviceid(const char *name_template); char *deviceid_from_spec_str(const char *str, char **endp); @@ -294,6 +296,7 @@ struct cdev { void *priv; struct device_d *dev; struct list_head list; + struct list_head devices_list; char *name; unsigned long offset; size_t size; @@ -303,6 +306,8 @@ struct cdev { int devfs_create(struct cdev *); void devfs_remove(struct cdev *); struct cdev *cdev_by_name(const char *filename); +ssize_t cdev_read(struct cdev *cdev, void *buf, size_t count, ulong offset, ulong flags); +ssize_t cdev_write(struct cdev *cdev, const void *buf, size_t count, ulong offset, ulong flags); #define DEVFS_PARTITION_FIXED (1 << 0) #define DEVFS_PARTITION_READONLY (1 << 1) |