chiark / gitweb /
write_cd_rules: identity-based persistence
[elogind.git] / extras / usb_id / usb_id.c
index 783d546b26288db78ba5c607820714a80da022e2..ba8bfdf8c51475772288499cd90f4340d5123264 100644 (file)
@@ -61,7 +61,6 @@ static char type_str[16];
 static int use_usb_info;
 static int use_num_info;
 static int export;
-static int debug;
 
 static void set_str(char *to, const char *from, size_t count)
 {
@@ -256,7 +255,7 @@ static int usb_id(const char *devpath)
 
        if_class = sysfs_attr_get_value(dev_interface->devpath, "bInterfaceClass");
        if (!if_class) {
-               info("%s: cannot get bInterfaceClass attribute", dev_interface->kernel_name);
+               info("%s: cannot get bInterfaceClass attribute", dev_interface->kernel);
                return 1;
        }
        if_class_num = strtoul(if_class, NULL, 16);
@@ -290,28 +289,28 @@ static int usb_id(const char *devpath)
                /* Generic SPC-2 device */
                scsi_vendor = sysfs_attr_get_value(dev_scsi->devpath, "vendor");
                if (!scsi_vendor) {
-                       info("%s: cannot get SCSI vendor attribute", dev_scsi->kernel_name);
+                       info("%s: cannot get SCSI vendor attribute", dev_scsi->kernel);
                        goto fallback;
                }
                set_str(vendor_str, scsi_vendor, sizeof(vendor_str)-1);
 
                scsi_model = sysfs_attr_get_value(dev_scsi->devpath, "model");
                if (!scsi_model) {
-                       info("%s: cannot get SCSI model attribute", dev_scsi->kernel_name);
+                       info("%s: cannot get SCSI model attribute", dev_scsi->kernel);
                        goto fallback;
                }
                set_str(model_str, scsi_model, sizeof(model_str)-1);
 
                scsi_type = sysfs_attr_get_value(dev_scsi->devpath, "type");
                if (!scsi_type) {
-                       info("%s: cannot get SCSI type attribute", dev_scsi->kernel_name);
+                       info("%s: cannot get SCSI type attribute", dev_scsi->kernel);
                        goto fallback;
                }
                set_scsi_type(type_str, scsi_type, sizeof(type_str)-1);
 
                scsi_rev = sysfs_attr_get_value(dev_scsi->devpath, "rev");
                if (!scsi_rev) {
-                       info("%s: cannot get SCSI revision attribute", dev_scsi->kernel_name);
+                       info("%s: cannot get SCSI revision attribute", dev_scsi->kernel);
                        goto fallback;
                }
                set_str(revision_str, scsi_rev, sizeof(revision_str)-1);
@@ -371,14 +370,6 @@ int main(int argc, char **argv)
 
        dbg("argc is %d", argc);
 
-       /* sysfs path can be overridden for testing */
-       env = getenv("SYSFS_PATH");
-       if (env) {
-               strlcpy(sysfs_path, env, sizeof(sysfs_path));
-               remove_trailing_chars(sysfs_path, '/');
-       } else
-               strcpy(sysfs_path, "/sys");
-
        while ((option = getopt(argc, argv, "dnux")) != -1 ) {
                if (optarg)
                        dbg("option '%c' arg '%s'", option, optarg);
@@ -386,9 +377,6 @@ int main(int argc, char **argv)
                        dbg("option '%c'", option);
 
                switch (option) {
-               case 'd':
-                       debug = 1;
-                       break;
                case 'n':
                        use_num_info = 1;
                        use_usb_info = 1;