linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udevinfo patch
@ 2004-03-23 21:51 Daniel Stekloff
  2004-03-23 22:42 ` Kay Sievers
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Daniel Stekloff @ 2004-03-23 21:51 UTC (permalink / raw)
  To: linux-hotplug



Hi Greg,

I think this is what you want for udevinfo. Patched against the latest BK
tree. I tested it and it seemed to work.

One other question, shouldn't udevinfo.c:print_all_attributes() check to
make sure attr->method is SYSFS_METHOD_SHOW along with checking to see
if attr->value != NULL or doesn't that matter?

Here's the libsysfs fix for print_device_chain():

PATCH FOLLOWS:
-------------


--- udev/udevinfo.c	2004-03-23 10:00:49.178443896 -0800
+++ udev-fix/udevinfo.c	2004-03-23 13:40:19.197296704 -0800
@@ -158,7 +158,6 @@
 	       "to match the device for which the node will be created.\n"
 	       "\n");
 	printf("device '%s' has major:minor %s", class_dev->path, attr->value);
-	sysfs_close_attribute(attr);
 
 	/* open sysfs class device directory and print all attributes */
 	printf("  looking at class device '%s':\n", class_dev->path);
@@ -170,11 +169,11 @@
 
 	/* get the device link (if parent exists look here) */
 	class_dev_parent = sysfs_get_classdev_parent(class_dev);
-	if (class_dev_parent != NULL) {
-		//sysfs_close_class_device(class_dev);
-		class_dev = class_dev_parent;
-	}
-	sysfs_dev = sysfs_get_classdev_device(class_dev);
+	if (class_dev_parent != NULL) 
+		sysfs_dev = sysfs_get_classdev_device(class_dev_parent);
+	else 
+		sysfs_dev = sysfs_get_classdev_device(class_dev);
+	
 	if (sysfs_dev != NULL)
 		printf("follow the class device's \"device\"\n");
 
@@ -191,13 +190,11 @@
 		if (sysfs_dev_parent = NULL)
 			break;
 
-		//sysfs_close_device(sysfs_dev);
 		sysfs_dev = sysfs_dev_parent;
 	}
-	sysfs_close_device(sysfs_dev);
 
 exit:
-	//sysfs_close_class_device(class_dev);
+	sysfs_close_class_device(class_dev);
 	return retval;
 }
 


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-03-31 23:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-23 21:51 udevinfo patch Daniel Stekloff
2004-03-23 22:42 ` Kay Sievers
2004-03-24 17:49 ` Greg KH
2004-03-26  0:26 ` Carl-Daniel Hailfinger
2004-03-26  3:47 ` Kay Sievers
2004-03-26  5:25 ` Carl-Daniel Hailfinger
2004-03-26  5:35 ` Ananth N Mavinakayanahalli
2004-03-26 10:15 ` Kay Sievers
2004-03-26 10:24 ` Kay Sievers
2004-03-26 12:50 ` Ananth N Mavinakayanahalli
2004-03-26 16:43 ` Carl-Daniel Hailfinger
2004-03-26 17:19 ` Kay Sievers
2004-03-31 23:00 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).