From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Reinecke Date: Wed, 25 Feb 2004 14:11:06 +0000 Subject: [PATCH] allow non-block devices for udevinfo Message-Id: <403CACFA.8080308@suse.de> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------070606070802020409000303" List-Id: To: linux-hotplug@vger.kernel.org This is a multi-part message in MIME format. --------------070606070802020409000303 Content-Type: text/plain; charset="iso-8859-1"; format="flowed" Content-Transfer-Encoding: quoted-printable Hi all, with the attached patch to udevinfo it is possible to look also at=20 devices in /class which do not provide the 'dev' attribute, e.g. net=20 devices. Agreed, it is of limited usefulness as it stands, but with it we can=20 check devices for consistency with the 'standard' or 'acceptable'=20 behaviour re. sysfs. And complain loudly to the driver maintainer if=20 they don't (Hi Arnd !). Cheers, Hannes --=20 Dr. Hannes Reinecke hare@suse.de SuSE Linux AG S390 & zSeries Maxfeldstra=DFe 5 +49 911 74053 688 90409 N=FCrnberg http://www.suse.de --------------070606070802020409000303 Content-Type: text/plain; name="udevinfo-net.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="udevinfo-net.patch" ===== udevinfo.c 1.13 vs edited ===== --- 1.13/udevinfo.c Mon Feb 23 20:07:25 2004 +++ edited/udevinfo.c Wed Feb 25 14:44:02 2004 @@ -143,14 +143,12 @@ /* 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; + if (attr) { + printf("\ndevice '%s' has major:minor %s", class_dev->path, + attr->value); + sysfs_close_attribute(attr); } - printf("\ndevice '%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); if (print_all_attributes(class_dev->path) != 0) { --------------070606070802020409000303-- ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&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