summaryrefslogtreecommitdiff
path: root/udevinfo.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 /udevinfo.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 'udevinfo.c')
-rw-r--r--udevinfo.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/udevinfo.c b/udevinfo.c
index 1a10f9ad07..d6f564079f 100644
--- a/udevinfo.c
+++ b/udevinfo.c
@@ -45,7 +45,7 @@ void log_message (int priority, const char *format, ...)
}
#endif
-static void print_all_attributes(const char *devpath)
+static void print_all_attributes(const char *devpath, const char *key)
{
char path[PATH_SIZE];
DIR *dir;
@@ -80,7 +80,7 @@ static void print_all_attributes(const char *devpath)
}
replace_untrusted_chars(value);
- printf(" SYSFS{%s}==\"%s\"\n", dent->d_name, value);
+ printf(" %s{%s}==\"%s\"\n", key, dent->d_name, value);
}
}
printf("\n");
@@ -103,10 +103,10 @@ static int print_device_chain(const char *devpath)
return -1;
printf(" looking at device '%s':\n", dev->devpath);
- printf(" KERNEL==\"%s\"\n", dev->kernel_name);
+ printf(" KERNEL==\"%s\"\n", dev->kernel);
printf(" SUBSYSTEM==\"%s\"\n", dev->subsystem);
printf(" DRIVER==\"%s\"\n", dev->driver);
- print_all_attributes(dev->devpath);
+ print_all_attributes(dev->devpath, "ATTR");
/* walk up the chain of devices */
while (1) {
@@ -114,11 +114,11 @@ static int print_device_chain(const char *devpath)
if (dev == NULL)
break;
printf(" looking at parent device '%s':\n", dev->devpath);
- printf(" ID==\"%s\"\n", dev->kernel_name);
- printf(" BUS==\"%s\"\n", dev->subsystem);
- printf(" DRIVER==\"%s\"\n", dev->driver);
+ printf(" KERNELS==\"%s\"\n", dev->kernel);
+ printf(" SUBSYTEMS==\"%s\"\n", dev->subsystem);
+ printf(" DRIVERS==\"%s\"\n", dev->driver);
- print_all_attributes(dev->devpath);
+ print_all_attributes(dev->devpath, "ATTRS");
}
return 0;