hal/hald/linux class_device.c,1.8,1.9 osspec.c,1.12,1.13

David Zeuthen david at pdx.freedesktop.org
Thu Apr 22 11:16:19 PDT 2004


Update of /cvs/hal/hal/hald/linux
In directory pdx:/tmp/cvs-serv14881/hald/linux

Modified Files:
	class_device.c osspec.c 
Log Message:
2004-04-22  David Zeuthen  <david at fubar.dk>

	* hald/linux/class_device.c (class_device_got_sysdevice): Instead
	of refusing to merge onto a socalled virtual device (which is really
	a HAL term, and thus quite crackful), just special-case the fact
	that we don't want to merge onto a usb interface but we prefer to
	merge onto the usb device. Which is sane and quite nice. 
	This makes the scsi_device receive the scsi_generic class stuff and
	thus the scsi_generic.device_file=sg0 property. Which is also sane
	and quite nice (think SCSI multi-lun devices).

	* hald/linux/osspec.c (remove_class_device): Make a more concise
	statement in the log message about the fact that removal of class
	devices is not yet implemented; add @todo tag so this is not
	forgotton

	* doc/TODO: Add note about removal of class devices



Index: class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/class_device.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- a/class_device.c	21 Apr 2004 18:44:41 -0000	1.8
+++ b/class_device.c	22 Apr 2004 18:16:17 -0000	1.9
@@ -298,8 +298,6 @@
 			    gpointer user_data)
 {
 	AsyncInfo *ai = user_data;
-	const char *parent_udi;
-	HalDevice *parent_device;
 	HalDevice *d = (HalDevice *) ai->device;
 	ClassDeviceHandler *self = ai->handler;
 
@@ -313,12 +311,16 @@
 		return;
 	}
 
-	/* if the sysdevice is virtual, ascent into the closest non-
-	 * virtual device */
-	while (hal_device_has_property (sysdevice, "info.virtual") &&
-	       hal_device_property_get_bool (sysdevice, "info.virtual") &&
-	       (parent_udi = 
-		hal_device_property_get_string (sysdevice, "info.parent")) != NULL ) {
+	/* special case : merge onto the usb device, not the usb interface */
+	if (hal_device_has_property (sysdevice, "info.bus") &&
+	    hal_device_has_property (sysdevice, "info.parent") &&
+	    (strcmp (hal_device_property_get_string (sysdevice, "info.bus"),
+						     "usbif") == 0)) {
+		const char *parent_udi;
+		HalDevice *parent_device;
+
+		parent_udi = hal_device_property_get_string (sysdevice, 
+							     "info.parent");
 		parent_device = hal_device_store_find (hald_get_gdl (),
 						       parent_udi);
 		if (parent_device != NULL) {

Index: osspec.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/osspec.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- a/osspec.c	21 Apr 2004 18:44:41 -0000	1.12
+++ b/osspec.c	22 Apr 2004 18:16:17 -0000	1.13
@@ -402,10 +402,12 @@
 		 * sysdevice it belongs to. Ughh.. It's only a big deal when
 		 * loading/unloading drivers and this should never happen
 		 * on a desktop anyway?
+		 *
+		 * @todo FIXME
 		 */
 
-		HAL_WARNING (("Cannot yet remove class device @ %s on "
-			      "hotplug remove", path));
+		HAL_WARNING (("Removal of class device @ %s on "
+			      "hotplug remove is not yet implemented", path));
 
 	} else {
 		/*HAL_INFO (("Removing device @ sysfspath %s, udi %s", 





More information about the hal-commit mailing list