- printf("device '%s' has major:minor %s", class_dev->path, attr->value);
- sysfs_close_attribute(attr);
+
+ if (type == 'b' || type =='c') {
+ /* read the 'dev' file for major/minor*/
+ attr = sysfs_get_classdev_attr(class_dev, "dev");
+ if (attr == NULL) {
+ printf("couldn't get the \"dev\" file\n");
+ retval = -1;
+ goto exit;
+ }
+ printf("device '%s' has major:minor %s", class_dev->path, attr->value);
+ }