14
14
* all) PA-RISC machines should have them. Anyway, for safety reasons, the
15
15
* following code can deal with just 96 bytes of Stable Storage, and all
16
16
* sizes between 96 and 192 bytes (provided they are multiple of struct
17
- * device_path size, eg: 128, 160 and 192) to provide full information.
17
+ * pdc_module_path size, eg: 128, 160 and 192) to provide full information.
18
18
* One last word: there's one path we can always count on: the primary path.
19
19
* Anything above 224 bytes is used for 'osdep2' OS-dependent storage area.
20
20
*
@@ -88,7 +88,7 @@ struct pdcspath_entry {
88
88
short ready ; /* entry record is valid if != 0 */
89
89
unsigned long addr ; /* entry address in stable storage */
90
90
char * name ; /* entry name */
91
- struct device_path devpath ; /* device path in parisc representation */
91
+ struct pdc_module_path devpath ; /* device path in parisc representation */
92
92
struct device * dev ; /* corresponding device */
93
93
struct kobject kobj ;
94
94
};
@@ -138,7 +138,7 @@ struct pdcspath_attribute paths_attr_##_name = { \
138
138
static int
139
139
pdcspath_fetch (struct pdcspath_entry * entry )
140
140
{
141
- struct device_path * devpath ;
141
+ struct pdc_module_path * devpath ;
142
142
143
143
if (!entry )
144
144
return - EINVAL ;
@@ -153,7 +153,7 @@ pdcspath_fetch(struct pdcspath_entry *entry)
153
153
return - EIO ;
154
154
155
155
/* Find the matching device.
156
- NOTE: hardware_path overlays with device_path , so the nice cast can
156
+ NOTE: hardware_path overlays with pdc_module_path , so the nice cast can
157
157
be used */
158
158
entry -> dev = hwpath_to_device ((struct hardware_path * )devpath );
159
159
@@ -179,7 +179,7 @@ pdcspath_fetch(struct pdcspath_entry *entry)
179
179
static void
180
180
pdcspath_store (struct pdcspath_entry * entry )
181
181
{
182
- struct device_path * devpath ;
182
+ struct pdc_module_path * devpath ;
183
183
184
184
BUG_ON (!entry );
185
185
@@ -221,7 +221,7 @@ static ssize_t
221
221
pdcspath_hwpath_read (struct pdcspath_entry * entry , char * buf )
222
222
{
223
223
char * out = buf ;
224
- struct device_path * devpath ;
224
+ struct pdc_module_path * devpath ;
225
225
short i ;
226
226
227
227
if (!entry || !buf )
@@ -236,11 +236,11 @@ pdcspath_hwpath_read(struct pdcspath_entry *entry, char *buf)
236
236
return - ENODATA ;
237
237
238
238
for (i = 0 ; i < 6 ; i ++ ) {
239
- if (devpath -> bc [i ] >= 128 )
239
+ if (devpath -> path . bc [i ] < 0 )
240
240
continue ;
241
- out += sprintf (out , "%u /" , ( unsigned char ) devpath -> bc [i ]);
241
+ out += sprintf (out , "%d /" , devpath -> path . bc [i ]);
242
242
}
243
- out += sprintf (out , "%u\n" , (unsigned char )devpath -> mod );
243
+ out += sprintf (out , "%u\n" , (unsigned char )devpath -> path . mod );
244
244
245
245
return out - buf ;
246
246
}
@@ -296,12 +296,12 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun
296
296
for (i = 5 ; ((temp = strrchr (in , '/' ))) && (temp - in > 0 ) && (likely (i )); i -- ) {
297
297
hwpath .bc [i ] = simple_strtoul (temp + 1 , NULL , 10 );
298
298
in [temp - in ] = '\0' ;
299
- DPRINTK ("%s: bc[%d]: %d\n" , __func__ , i , hwpath .bc [i ]);
299
+ DPRINTK ("%s: bc[%d]: %d\n" , __func__ , i , hwpath .path . bc [i ]);
300
300
}
301
301
302
302
/* Store the final field */
303
303
hwpath .bc [i ] = simple_strtoul (in , NULL , 10 );
304
- DPRINTK ("%s: bc[%d]: %d\n" , __func__ , i , hwpath .bc [i ]);
304
+ DPRINTK ("%s: bc[%d]: %d\n" , __func__ , i , hwpath .path . bc [i ]);
305
305
306
306
/* Now we check that the user isn't trying to lure us */
307
307
if (!(dev = hwpath_to_device ((struct hardware_path * )& hwpath ))) {
@@ -342,7 +342,7 @@ static ssize_t
342
342
pdcspath_layer_read (struct pdcspath_entry * entry , char * buf )
343
343
{
344
344
char * out = buf ;
345
- struct device_path * devpath ;
345
+ struct pdc_module_path * devpath ;
346
346
short i ;
347
347
348
348
if (!entry || !buf )
@@ -547,7 +547,7 @@ static ssize_t pdcs_auto_read(struct kobject *kobj,
547
547
pathentry = & pdcspath_entry_primary ;
548
548
549
549
read_lock (& pathentry -> rw_lock );
550
- out += sprintf (out , "%s\n" , (pathentry -> devpath .flags & knob ) ?
550
+ out += sprintf (out , "%s\n" , (pathentry -> devpath .path . flags & knob ) ?
551
551
"On" : "Off" );
552
552
read_unlock (& pathentry -> rw_lock );
553
553
@@ -594,8 +594,8 @@ static ssize_t pdcs_timer_read(struct kobject *kobj,
594
594
595
595
/* print the timer value in seconds */
596
596
read_lock (& pathentry -> rw_lock );
597
- out += sprintf (out , "%u\n" , (pathentry -> devpath .flags & PF_TIMER ) ?
598
- (1 << (pathentry -> devpath .flags & PF_TIMER )) : 0 );
597
+ out += sprintf (out , "%u\n" , (pathentry -> devpath .path . flags & PF_TIMER ) ?
598
+ (1 << (pathentry -> devpath .path . flags & PF_TIMER )) : 0 );
599
599
read_unlock (& pathentry -> rw_lock );
600
600
601
601
return out - buf ;
@@ -764,7 +764,7 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
764
764
765
765
/* Be nice to the existing flag record */
766
766
read_lock (& pathentry -> rw_lock );
767
- flags = pathentry -> devpath .flags ;
767
+ flags = pathentry -> devpath .path . flags ;
768
768
read_unlock (& pathentry -> rw_lock );
769
769
770
770
DPRINTK ("%s: flags before: 0x%X\n" , __func__ , flags );
@@ -785,7 +785,7 @@ static ssize_t pdcs_auto_write(struct kobject *kobj,
785
785
write_lock (& pathentry -> rw_lock );
786
786
787
787
/* Change the path entry flags first */
788
- pathentry -> devpath .flags = flags ;
788
+ pathentry -> devpath .path . flags = flags ;
789
789
790
790
/* Now, dive in. Write back to the hardware */
791
791
pdcspath_store (pathentry );
0 commit comments