summaryrefslogtreecommitdiff
path: root/lib/sysfs_driver.c
diff options
context:
space:
mode:
authormananth <mananth>2004-02-04 10:51:50 +0000
committermananth <mananth>2004-02-04 10:51:50 +0000
commit6cbd7ae67a04b1f0c3269ab3aae2d8ee0efa5a89 (patch)
treeab728dfb40bed686bf802e7e92545e02ea8131b6 /lib/sysfs_driver.c
parent06d8ed8e147b05fd41c4ba0a36b7c67760d181a9 (diff)
downloadsysfsutils-6cbd7ae67a04b1f0c3269ab3aae2d8ee0efa5a89.tar.gz
Sorting support, removed unneeded functions and other cosmetic changes
Diffstat (limited to 'lib/sysfs_driver.c')
-rw-r--r--lib/sysfs_driver.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sysfs_driver.c b/lib/sysfs_driver.c
index 636219a..6a7cf68 100644
--- a/lib/sysfs_driver.c
+++ b/lib/sysfs_driver.c
@@ -178,7 +178,7 @@ struct sysfs_attribute *sysfs_get_driver_attr(struct sysfs_driver *drv,
}
attrlist = sysfs_get_driver_attributes(drv);
- if (attrlist != NULL)
+ if (attrlist == NULL)
return NULL;
return sysfs_get_directory_attribute(drv->directory,
@@ -244,7 +244,8 @@ struct dlist *sysfs_get_driver_devices(struct sysfs_driver *driver)
driver->devices = dlist_new_with_delete
(sizeof(struct sysfs_device),
sysfs_close_driver_device);
- dlist_unshift(driver->devices, device);
+ dlist_unshift_sorted(driver->devices, device,
+ sort_list);
}
}
return (driver->devices);