diff options
author | Karel Zak | 2015-05-28 12:09:41 +0200 |
---|---|---|
committer | Karel Zak | 2015-05-28 12:09:41 +0200 |
commit | 6c62abc42bb1c2aad60d0da1ce3f7498ac48cd1b (patch) | |
tree | 54c6cbf4b0a972c7bf63ae2da33077ad7d9f307e /include/sysfs.h | |
parent | lib/sysfs: Fix /dev to /sys node name translation (diff) | |
download | kernel-qcow2-util-linux-6c62abc42bb1c2aad60d0da1ce3f7498ac48cd1b.tar.gz kernel-qcow2-util-linux-6c62abc42bb1c2aad60d0da1ce3f7498ac48cd1b.tar.xz kernel-qcow2-util-linux-6c62abc42bb1c2aad60d0da1ce3f7498ac48cd1b.zip |
lib/sysfs: rename devname functions, cleanup
Well, I don't have mental power to use function names like
sysfs_devname_to_dev_name()
so this patch renames to
sysfs_devname_sys_to_dev()
sysfs_devname_dev_to_sys()
It also cleanups usage of the functions. We have to be sure that
sysfs.c code returns regular devnames. The existence of the sysfs
devnames (with '!') should be completely hidden in sysfs specific
code.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/sysfs.h')
-rw-r--r-- | include/sysfs.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/include/sysfs.h b/include/sysfs.h index 6b08bbed5..55213780c 100644 --- a/include/sysfs.h +++ b/include/sysfs.h @@ -92,7 +92,7 @@ extern int sysfs_scsi_has_attribute(struct sysfs_cxt *cxt, const char *attr); extern int sysfs_scsi_path_contains(struct sysfs_cxt *cxt, const char *pattern); /** - * sysfs_devname_to_dev_name: + * sysfs_devname_sys_to_dev: * @name: devname to be converted in place * * Linux kernel linux/drivers/base/core.c: device_get_devnode() @@ -100,7 +100,7 @@ extern int sysfs_scsi_path_contains(struct sysfs_cxt *cxt, const char *pattern); * /dev device name. This helper replaces all ocurrences of '!' in * @name by '/' to convert from /sys to /dev. */ -static inline void sysfs_devname_to_dev_name (char *name) +static inline void sysfs_devname_sys_to_dev(char *name) { char *c; @@ -110,15 +110,12 @@ static inline void sysfs_devname_to_dev_name (char *name) } /** - * sysfs_dev_name_to_devname: + * sysfs_devname_dev_to_sys: * @name: devname to be converted in place * - * Linux kernel linux/drivers/base/core.c: device_get_devnode() - * defines a replacement of '!' in the /sys device name by '/' in the - * /dev device name. This helper replaces all ocurrences of '/' in - * @name by '!' to convert from /dev to /sys. + * See sysfs_devname_sys_to_dev(). */ -static inline void sysfs_dev_name_to_devname (char *name) +static inline void sysfs_devname_dev_to_sys(char *name) { char *c; |