Browse Source

Improved debug messages

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
f5dde85e16
1 changed files with 13 additions and 12 deletions
  1. 13
    12
      src/core/dev.c

+ 13
- 12
src/core/dev.c View File

@@ -47,8 +47,10 @@ static inline int next_location ( struct bus_driver **bus_driver,
47 47
 		return 1;
48 48
 
49 49
 	/* Move to first (zeroed) location on next bus, if any */
50
-	if ( ++(*bus_driver) < bus_drivers_end )
50
+	if ( ++(*bus_driver) < bus_drivers_end ) {
51
+		DBG ( "DEV scanning %s bus\n", (*bus_driver)->name );
51 52
 		return 1;
53
+	}
52 54
 
53 55
 	/* Reset to first bus, return "no more locations" */
54 56
 	*bus_driver = bus_drivers;
@@ -63,18 +65,18 @@ static inline int next_location ( struct bus_driver **bus_driver,
63 65
  */
64 66
 int find_any ( struct bus_driver **bus_driver, struct bus_loc *bus_loc,
65 67
 	       struct bus_dev *bus_dev, signed int skip ) {
66
-	DBG ( "DEV searching for any device\n" );
68
+	DBG ( "DEV scanning %s bus\n", (*bus_driver)->name );
67 69
 	do {
68 70
 		if ( --skip >= 0 )
69 71
 			continue;
70 72
 		if ( ! (*bus_driver)->fill_device ( bus_dev, bus_loc ) )
71 73
 			continue;
72 74
 		DBG ( "DEV found device %s\n",
73
-		      (*bus_driver)->describe ( bus_dev ) );
75
+		      (*bus_driver)->describe_device ( bus_dev ) );
74 76
 		return 1;
75 77
 	} while ( next_location ( bus_driver, bus_loc ) );
76 78
 
77
-	DBG ( "DEV found no device\n" );
79
+	DBG ( "DEV found no more devices\n" );
78 80
 	return 0;
79 81
 }
80 82
 
@@ -87,8 +89,6 @@ int find_any ( struct bus_driver **bus_driver, struct bus_loc *bus_loc,
87 89
 int find_by_device ( struct device_driver **device_driver,
88 90
 		     struct bus_driver *bus_driver, struct bus_dev *bus_dev,
89 91
 		     signed int skip ) {
90
-	DBG ( "DEV searching for a driver for device %s\n",
91
-	      bus_driver->describe ( bus_dev ) );
92 92
 	do {
93 93
 		if ( --skip >= 0 )
94 94
 			continue;
@@ -96,13 +96,15 @@ int find_by_device ( struct device_driver **device_driver,
96 96
 			continue;
97 97
 		if ( ! bus_driver->check_driver ( bus_dev, *device_driver ))
98 98
 			continue;
99
-		DBG ( "DEV found driver %s\n", (*device_driver)->name );
99
+		DBG ( "DEV found driver %s for device %s\n",
100
+		      (*device_driver)->name,
101
+		      bus_driver->describe_device ( bus_dev ) );
100 102
 		return 1;
101 103
 	} while ( ++(*device_driver) < device_drivers_end );
102 104
 	
103 105
 	/* Reset to first driver, return "not found" */
104 106
 	DBG ( "DEV found no driver for device %s\n",
105
-	      bus_driver->describe ( bus_dev ) );
107
+	      bus_driver->describe_device ( bus_dev ) );
106 108
 	*device_driver = device_drivers;
107 109
 	return 0;
108 110
 }
@@ -118,8 +120,6 @@ int find_by_driver ( struct bus_loc *bus_loc, struct bus_dev *bus_dev,
118 120
 		     signed int skip ) {
119 121
 	struct bus_driver *bus_driver = device_driver->bus_driver;
120 122
 	
121
-	DBG ( "DEV searching for a device for driver %s\n",
122
-	      device_driver->name );
123 123
 	do {
124 124
 		if ( --skip >= 0 )
125 125
 			continue;
@@ -127,8 +127,9 @@ int find_by_driver ( struct bus_loc *bus_loc, struct bus_dev *bus_dev,
127 127
 			continue;
128 128
 		if ( ! bus_driver->check_driver ( bus_dev, device_driver ) )
129 129
 			continue;
130
-		DBG ( "DEV found device %s\n",
131
-		      bus_driver->describe ( bus_dev ) );
130
+		DBG ( "DEV found device %s for driver %s\n",
131
+		      bus_driver->describe_device ( bus_dev ),
132
+		      device_driver->name );
132 133
 		return 1;
133 134
 	} while ( bus_driver->next_location ( bus_loc ) );
134 135
 

Loading…
Cancel
Save