diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2005-04-15 16:28:56 +0200 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 23:55:01 -0700 |
commit | 197178360f5c4253aeb743b32224125e58e2fd5d (patch) | |
tree | df003d4a9dff23b2119fd7516f2dedc0ead1531c /libsysfs/sysfs_device.c | |
parent | d4b611430083674ee1d3aa19b87c9894ac3e39d8 (diff) |
[PATCH] libsysfs: version 2.0
Diffstat (limited to 'libsysfs/sysfs_device.c')
-rw-r--r-- | libsysfs/sysfs_device.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libsysfs/sysfs_device.c b/libsysfs/sysfs_device.c index 7087730d5f..d1c5b321f0 100644 --- a/libsysfs/sysfs_device.c +++ b/libsysfs/sysfs_device.c @@ -38,7 +38,6 @@ static int get_dev_driver(struct sysfs_device *dev) errno = EINVAL; return -1; } - memset(path, 0, SYSFS_PATH_MAX); memset(devpath, 0, SYSFS_PATH_MAX); safestrcpymax(path, dev->path, SYSFS_PATH_MAX); @@ -53,9 +52,9 @@ static int get_dev_driver(struct sysfs_device *dev) } /* - * Devices on on earlier kernels do not have the "driver" link. + * Devices on earlier kernels do not have the "driver" link. * Look it up in the bus directory. - */ + */ if (dev->bus[0] == '\0') return -1; memset(path, 0, SYSFS_PATH_MAX); @@ -81,7 +80,7 @@ static int get_dev_driver(struct sysfs_device *dev) safestrcat(devpath, drv); safestrcat(devpath, "/"); safestrcat(devpath, dev->bus_id); - if (sysfs_path_is_link(devpath) == 0) { + if (!sysfs_path_is_link(devpath)) { safestrcpy(dev->driver_name, drv); sysfs_close_list(drvlist); return 0; @@ -149,7 +148,7 @@ int sysfs_get_device_bus(struct sysfs_device *dev) safestrcat(path, SYSFS_DEVICES_NAME); safestrcat(path, "/"); safestrcat(path, dev->bus_id); - if ((sysfs_path_is_link(path)) == 0) { + if (!sysfs_path_is_link(path)) { memset(target, 0, SYSFS_PATH_MAX); if (sysfs_get_link(path, target, SYSFS_PATH_MAX)) { |