summaryrefslogtreecommitdiff
path: root/udev_sysfs.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-08-19 16:06:25 +0200
committerKay Sievers <kay.sievers@suse.de>2006-08-19 16:06:25 +0200
commit95776dc6ec174f47fa4dd4d8abf5d457223e5dd4 (patch)
treeff9f2e24f8333d460509c7fb987ce2ecb37605e1 /udev_sysfs.c
parenteef7c9a385575375a3e3310900022b37777aeb6c (diff)
consistent key naming to match only the event device or include all parent devices
This scheme is more consistent and makes it obvious if a match happens against the event device only, or the full chain of parent devices. The old key names are now: BUS -> SUBSYSTEMS ID -> KERNELS SYSFS -> ATTRS DRIVER -> DRIVERS Match keys for the event device: KERNEL SUBSYSTEM ATTR DRIVER (in a future release, for now the same as DRIVERS) Match keys for all devices along the parent device chain: KERNELS SUBSYSTEMS ATTRS DRIVERS ID, BUS, SYSFS are no longer mentioned in the man page but still work. DRIVER must be converted to DRIVERS to match the new scheme. For now, an error is logged, if DRIVER is used. In a future release, the DRIVER key behaviour will change.
Diffstat (limited to 'udev_sysfs.c')
-rw-r--r--udev_sysfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/udev_sysfs.c b/udev_sysfs.c
index 85ea4d15e9..c4afe0cffb 100644
--- a/udev_sysfs.c
+++ b/udev_sysfs.c
@@ -95,11 +95,11 @@ void sysfs_device_set_values(struct sysfs_device *dev, const char *devpath,
if (pos == NULL)
return;
- strlcpy(dev->kernel_name, &pos[1], sizeof(dev->kernel_name));
- dbg("kernel_name='%s'", dev->kernel_name);
+ strlcpy(dev->kernel, &pos[1], sizeof(dev->kernel));
+ dbg("kernel='%s'", dev->kernel);
/* some devices have '!' in their name, change that to '/' */
- pos = dev->kernel_name;
+ pos = dev->kernel;
while (pos[0] != '\0') {
if (pos[0] == '!')
pos[0] = '/';
@@ -107,7 +107,7 @@ void sysfs_device_set_values(struct sysfs_device *dev, const char *devpath,
}
/* get kernel number */
- pos = &dev->kernel_name[strlen(dev->kernel_name)];
+ pos = &dev->kernel[strlen(dev->kernel)];
while (isdigit(pos[-1]))
pos--;
strlcpy(dev->kernel_number, pos, sizeof(dev->kernel_number));