hal/hald/linux block_class_device.c, 1.40, 1.41 class_device.c, 1.20, 1.21 common.c, 1.9, 1.10 ieee1394_class_device.c, 1.2, 1.3 ieee1394_host_class_device.c, 1.2, 1.3 ieee1394_node_class_device.c, 1.2, 1.3 osspec.c, 1.25, 1.26

David Zeuthen david at freedesktop.org
Tue Jul 20 10:27:18 PDT 2004


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

Modified Files:
	block_class_device.c class_device.c common.c 
	ieee1394_class_device.c ieee1394_host_class_device.c 
	ieee1394_node_class_device.c osspec.c 
Log Message:
2004-07-20  David Zeuthen  <david at fubar.dk>

	* hald/linux/block_class_device.c: (block_class_visit):
	* hald/linux/class_device.c: (class_device_accept),
	(class_device_visit):
	* hald/linux/common.c: (drivers_collect):
	* hald/linux/ieee1394_class_device.c: (ieee1394_class_pre_process):
	* hald/linux/ieee1394_host_class_device.c:
	(ieee1394_host_class_pre_process):
	* hald/linux/ieee1394_node_class_device.c:
	(ieee1394_node_class_pre_process):
	* hald/linux/osspec.c: (visit_class_device):
	* hald/linux/volume_id/volume_id.c:
	More updates to libsysfs 1.1; from Joe Shaw's earlier patch



Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- block_class_device.c	15 Jul 2004 21:43:15 -0000	1.40
+++ block_class_device.c	20 Jul 2004 17:27:16 -0000	1.41
@@ -100,6 +100,7 @@
 	HalDevice *d;
 	char *parent_sysfs_path;
 	ClassAsyncData *cad;
+	struct sysfs_device *sysdevice;
 
 	/* only care about given sysfs class name */
 	if (strcmp (class_device->classname, "block") != 0)
@@ -115,11 +116,13 @@
 
 	hal_device_property_set_bool (d, "block.no_partitions", FALSE);
 
-	if (class_device->sysdevice == NULL) {
+	sysdevice = sysfs_get_classdev_device (class_device);
+
+	if (sysdevice == NULL) {
 		parent_sysfs_path = get_parent_sysfs_path (path);
 		hal_device_property_set_bool (d, "block.is_volume", TRUE);
 	} else {
-		parent_sysfs_path = class_device->sysdevice->path;
+		parent_sysfs_path = sysdevice->path;
 		hal_device_property_set_bool (d, "block.is_volume", FALSE);
 	}
 

Index: class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/class_device.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- class_device.c	18 Jul 2004 15:21:23 -0000	1.20
+++ class_device.c	20 Jul 2004 17:27:16 -0000	1.21
@@ -78,7 +78,7 @@
 	  path, self->sysfs_class_name));*/
 
 	/* Don't care if there's no sysdevice */
-	if (class_device->sysdevice == NULL)
+	if (sysfs_get_classdev_device (class_device) == NULL)
 		return FALSE;
 
 	/* only care about given sysfs class name */
@@ -107,8 +107,11 @@
 	char dev_file[SYSFS_PATH_MAX];
 	char dev_file_prop_name[SYSFS_PATH_MAX];
 	gboolean merge_or_add;
+	struct sysfs_device *sysdevice;
 
-	if (class_device->sysdevice == NULL) {
+	sysdevice = sysfs_get_classdev_device (class_device);
+
+	if (sysdevice == NULL) {
 		merge_or_add = FALSE;
 	} else {
 		merge_or_add = self->merge_or_add;
@@ -136,9 +139,10 @@
 
 		hal_device_property_set_string (d, "linux.sysfs_path", path);
 
-		if (class_device->sysdevice != NULL) {
-			hal_device_property_set_string (d, "linux.sysfs_path_device", 
-							class_device->sysdevice->path);
+		if (sysdevice != NULL) {
+			hal_device_property_set_string (
+				d, "linux.sysfs_path_device", 
+				sysdevice->path);
 		}
 	} 
 
@@ -184,16 +188,16 @@
 		hal_device_store_match_key_value_string_async (
 			hald_get_gdl (),
 			"linux.sysfs_path_device",
-			class_device->sysdevice->path,
+			sysdevice->path,
 			class_device_got_sysdevice, cad,
 			HAL_LINUX_HOTPLUG_TIMEOUT);
 	} else {
 		char *parent_sysfs_path;
 		ClassAsyncData *cad = g_new0 (ClassAsyncData, 1);
 
-		if (class_device->sysdevice != NULL) {
+		if (sysdevice != NULL) {
 			parent_sysfs_path = 
-				get_parent_sysfs_path (class_device->sysdevice->path);
+				get_parent_sysfs_path (sysdevice->path);
 		} else {
 			parent_sysfs_path = "(none)";
 		}

Index: common.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/common.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- common.c	24 Jun 2004 21:47:49 -0000	1.9
+++ common.c	20 Jul 2004 17:27:16 -0000	1.10
@@ -854,9 +854,11 @@
 			      path));
 		goto out;
 	}
-	if (dir->subdirs != NULL) {
-		dlist_for_each_data (dir->subdirs, current,
-				     struct sysfs_directory) {
+
+	if (sysfs_get_dir_subdirs (dir) != NULL) {
+		dlist_for_each_data (sysfs_get_dir_subdirs (dir),
+				     current, struct sysfs_directory) {
+			
 			/*printf("name=%s\n", current->name); */
 
 			dir2 = sysfs_open_directory (current->path);
@@ -867,9 +869,12 @@
 				DIE (("Error reading sysfs directory "
 				      "at %s\n", current->path));
 
-			if (dir2->links != NULL) {
-				dlist_for_each_data (dir2->links, current2,
-						     struct sysfs_link) {
+
+			if (sysfs_get_dir_links (dir2) != NULL) {
+				dlist_for_each_data (
+					sysfs_get_dir_links (dir2),
+					current2, 
+					struct sysfs_link) {
 					/*printf("link=%s\n",current2->target);
 					 */
 					drivers_add_entry (current->name,
@@ -880,7 +885,7 @@
 			}
 		}
 	}
-out:
+ out:
 	if (dir != NULL)
 		sysfs_close_directory (dir);
 }

Index: ieee1394_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/ieee1394_class_device.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ieee1394_class_device.c	5 Jul 2004 18:21:07 -0000	1.2
+++ ieee1394_class_device.c	20 Jul 2004 17:27:16 -0000	1.3
@@ -57,13 +57,15 @@
 			    const char *sysfs_path,
 			    struct sysfs_class_device *class_device)
 {
+	struct sysfs_device *sysdevice;
 	struct sysfs_attribute *cur;
 	char attr_name[SYSFS_NAME_LEN];
 	int tmp;
 	int model_id = -1;
 	char *model_name = NULL;
 
-	dlist_for_each_data (sysfs_get_device_attributes (class_device->sysdevice),
+	sysdevice = sysfs_get_classdev_device (class_device);
+	dlist_for_each_data (sysfs_get_device_attributes (sysdevice),
 			     cur, struct sysfs_attribute) {
 		int len, i;
 

Index: ieee1394_host_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/ieee1394_host_class_device.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ieee1394_host_class_device.c	5 Jul 2004 18:21:07 -0000	1.2
+++ ieee1394_host_class_device.c	20 Jul 2004 17:27:16 -0000	1.3
@@ -27,6 +27,8 @@
 #  include <config.h>
 #endif
 
+#include <ctype.h>
+
 #include "../logger.h"
 #include "../device_store.h"
 #include "../hald.h"
@@ -57,11 +59,13 @@
 				 const char *sysfs_path,
 				 struct sysfs_class_device *class_device)
 {
+	struct sysfs_device *sysdevice;
 	struct sysfs_attribute *cur;
 	char attr_name[SYSFS_NAME_LEN];
 	int tmp;
 
-	dlist_for_each_data (sysfs_get_device_attributes (class_device->sysdevice),
+	sysdevice = sysfs_get_classdev_device (class_device);
+	dlist_for_each_data (sysfs_get_device_attributes (sysdevice),
 			     cur, struct sysfs_attribute) {
 		int len, i;
 

Index: ieee1394_node_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/ieee1394_node_class_device.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ieee1394_node_class_device.c	5 Jul 2004 18:21:07 -0000	1.2
+++ ieee1394_node_class_device.c	20 Jul 2004 17:27:16 -0000	1.3
@@ -57,13 +57,15 @@
 				 const char *sysfs_path,
 				 struct sysfs_class_device *class_device)
 {
+	struct sysfs_device *sysdevice;
 	struct sysfs_attribute *cur;
 	char attr_name[SYSFS_NAME_LEN];
 	int tmp;
 	const char *vendor_name = NULL;
 	int vendor_id;
 
-	dlist_for_each_data (sysfs_get_device_attributes (class_device->sysdevice),
+	sysdevice = sysfs_get_classdev_device (class_device);
+	dlist_for_each_data (sysfs_get_device_attributes (sysdevice),
 			     cur, struct sysfs_attribute) {
 		int len, i;
 

Index: osspec.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/osspec.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- osspec.c	18 Jul 2004 15:21:23 -0000	1.25
+++ osspec.c	20 Jul 2004 17:27:16 -0000	1.26
@@ -134,6 +134,7 @@
 {
 	int i;
 	struct sysfs_class_device *class_device;
+	struct sysfs_directory *dir;
 
 	class_device = sysfs_open_class_device_path (path);
 	if (class_device == NULL) {




More information about the hal-commit mailing list