summaryrefslogtreecommitdiff
path: root/lib/sysfs_device.c
diff options
context:
space:
mode:
authormananth <mananth>2003-10-15 12:16:35 +0000
committermananth <mananth>2003-10-15 12:16:35 +0000
commita8dc5520e8863135dd277f37711564a8b4c73a06 (patch)
treeea134160a2324f64e73d7913c0a85be88572c67c /lib/sysfs_device.c
parentfc281a0436d90c72d33044190c95eb00be67f08a (diff)
downloadsysfsutils-a8dc5520e8863135dd277f37711564a8b4c73a06.tar.gz
Corrected "write attribute" functions
Diffstat (limited to 'lib/sysfs_device.c')
-rw-r--r--lib/sysfs_device.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/sysfs_device.c b/lib/sysfs_device.c
index e37789c..6f28a24 100644
--- a/lib/sysfs_device.c
+++ b/lib/sysfs_device.c
@@ -73,20 +73,17 @@ struct sysfs_attribute *sysfs_get_device_attr(struct sysfs_device *dev,
const unsigned char *name)
{
struct sysfs_attribute *cur = NULL;
- unsigned char attrname[SYSFS_NAME_LEN];
if (dev == NULL || dev->directory == NULL
|| dev->directory->attributes == NULL || name == NULL) {
errno = EINVAL;
return NULL;
}
- dlist_for_each_data(dev->directory->attributes, cur,
- struct sysfs_attribute) {
- if (strcmp(cur->name, attrname) != 0)
- continue;
-
+
+ cur = sysfs_get_directory_attribute(dev->directory,
+ (unsigned char *)name);
+ if (cur != NULL)
return cur;
- }
return NULL;
}
@@ -350,8 +347,8 @@ struct dlist *sysfs_get_device_attributes(struct sysfs_device *device)
* returns struct sysfs_device if found, NULL otherwise
* NOTE: Use sysfs_close_device to close the device
*/
-struct sysfs_device *sysfs_open_device_by_name(char *dev_name, char *bus,
- size_t bsize)
+struct sysfs_device *sysfs_open_device_by_name(unsigned char *dev_name,
+ unsigned char *bus, size_t bsize)
{
char sysfs_path[SYSFS_PATH_MAX], device_path[SYSFS_PATH_MAX];
struct sysfs_device *device = NULL;