6
6
* published by the Free Software Foundation.
7
7
*/
8
8
#include <linux/init.h>
9
- #include <linux/sysdev .h>
9
+ #include <linux/device .h>
10
10
#include <linux/seq_file.h>
11
11
#include <linux/cpu.h>
12
12
#include <linux/module.h>
@@ -26,16 +26,16 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
26
26
* XXX: If/when a SMP-capable implementation of AVR32 will ever be
27
27
* made, we must make sure that the code executes on the correct CPU.
28
28
*/
29
- static ssize_t show_pc0event (struct sys_device * dev ,
30
- struct sysdev_attribute * attr , char * buf )
29
+ static ssize_t show_pc0event (struct device * dev ,
30
+ struct device_attribute * attr , char * buf )
31
31
{
32
32
unsigned long pccr ;
33
33
34
34
pccr = sysreg_read (PCCR );
35
35
return sprintf (buf , "0x%lx\n" , (pccr >> 12 ) & 0x3f );
36
36
}
37
- static ssize_t store_pc0event (struct sys_device * dev ,
38
- struct sysdev_attribute * attr , const char * buf ,
37
+ static ssize_t store_pc0event (struct device * dev ,
38
+ struct device_attribute * attr , const char * buf ,
39
39
size_t count )
40
40
{
41
41
unsigned long val ;
@@ -48,16 +48,16 @@ static ssize_t store_pc0event(struct sys_device *dev,
48
48
sysreg_write (PCCR , val );
49
49
return count ;
50
50
}
51
- static ssize_t show_pc0count (struct sys_device * dev ,
52
- struct sysdev_attribute * attr , char * buf )
51
+ static ssize_t show_pc0count (struct device * dev ,
52
+ struct device_attribute * attr , char * buf )
53
53
{
54
54
unsigned long pcnt0 ;
55
55
56
56
pcnt0 = sysreg_read (PCNT0 );
57
57
return sprintf (buf , "%lu\n" , pcnt0 );
58
58
}
59
- static ssize_t store_pc0count (struct sys_device * dev ,
60
- struct sysdev_attribute * attr ,
59
+ static ssize_t store_pc0count (struct device * dev ,
60
+ struct device_attribute * attr ,
61
61
const char * buf , size_t count )
62
62
{
63
63
unsigned long val ;
@@ -71,16 +71,16 @@ static ssize_t store_pc0count(struct sys_device *dev,
71
71
return count ;
72
72
}
73
73
74
- static ssize_t show_pc1event (struct sys_device * dev ,
75
- struct sysdev_attribute * attr , char * buf )
74
+ static ssize_t show_pc1event (struct device * dev ,
75
+ struct device_attribute * attr , char * buf )
76
76
{
77
77
unsigned long pccr ;
78
78
79
79
pccr = sysreg_read (PCCR );
80
80
return sprintf (buf , "0x%lx\n" , (pccr >> 18 ) & 0x3f );
81
81
}
82
- static ssize_t store_pc1event (struct sys_device * dev ,
83
- struct sysdev_attribute * attr , const char * buf ,
82
+ static ssize_t store_pc1event (struct device * dev ,
83
+ struct device_attribute * attr , const char * buf ,
84
84
size_t count )
85
85
{
86
86
unsigned long val ;
@@ -93,16 +93,16 @@ static ssize_t store_pc1event(struct sys_device *dev,
93
93
sysreg_write (PCCR , val );
94
94
return count ;
95
95
}
96
- static ssize_t show_pc1count (struct sys_device * dev ,
97
- struct sysdev_attribute * attr , char * buf )
96
+ static ssize_t show_pc1count (struct device * dev ,
97
+ struct device_attribute * attr , char * buf )
98
98
{
99
99
unsigned long pcnt1 ;
100
100
101
101
pcnt1 = sysreg_read (PCNT1 );
102
102
return sprintf (buf , "%lu\n" , pcnt1 );
103
103
}
104
- static ssize_t store_pc1count (struct sys_device * dev ,
105
- struct sysdev_attribute * attr , const char * buf ,
104
+ static ssize_t store_pc1count (struct device * dev ,
105
+ struct device_attribute * attr , const char * buf ,
106
106
size_t count )
107
107
{
108
108
unsigned long val ;
@@ -116,16 +116,16 @@ static ssize_t store_pc1count(struct sys_device *dev,
116
116
return count ;
117
117
}
118
118
119
- static ssize_t show_pccycles (struct sys_device * dev ,
120
- struct sysdev_attribute * attr , char * buf )
119
+ static ssize_t show_pccycles (struct device * dev ,
120
+ struct device_attribute * attr , char * buf )
121
121
{
122
122
unsigned long pccnt ;
123
123
124
124
pccnt = sysreg_read (PCCNT );
125
125
return sprintf (buf , "%lu\n" , pccnt );
126
126
}
127
- static ssize_t store_pccycles (struct sys_device * dev ,
128
- struct sysdev_attribute * attr , const char * buf ,
127
+ static ssize_t store_pccycles (struct device * dev ,
128
+ struct device_attribute * attr , const char * buf ,
129
129
size_t count )
130
130
{
131
131
unsigned long val ;
@@ -139,16 +139,16 @@ static ssize_t store_pccycles(struct sys_device *dev,
139
139
return count ;
140
140
}
141
141
142
- static ssize_t show_pcenable (struct sys_device * dev ,
143
- struct sysdev_attribute * attr , char * buf )
142
+ static ssize_t show_pcenable (struct device * dev ,
143
+ struct device_attribute * attr , char * buf )
144
144
{
145
145
unsigned long pccr ;
146
146
147
147
pccr = sysreg_read (PCCR );
148
148
return sprintf (buf , "%c\n" , (pccr & 1 )?'1' :'0' );
149
149
}
150
- static ssize_t store_pcenable (struct sys_device * dev ,
151
- struct sysdev_attribute * attr , const char * buf ,
150
+ static ssize_t store_pcenable (struct device * dev ,
151
+ struct device_attribute * attr , const char * buf ,
152
152
size_t count )
153
153
{
154
154
unsigned long pccr , val ;
@@ -167,12 +167,12 @@ static ssize_t store_pcenable(struct sys_device *dev,
167
167
return count ;
168
168
}
169
169
170
- static SYSDEV_ATTR (pc0event , 0600 , show_pc0event , store_pc0event );
171
- static SYSDEV_ATTR (pc0count , 0600 , show_pc0count , store_pc0count );
172
- static SYSDEV_ATTR (pc1event , 0600 , show_pc1event , store_pc1event );
173
- static SYSDEV_ATTR (pc1count , 0600 , show_pc1count , store_pc1count );
174
- static SYSDEV_ATTR (pccycles , 0600 , show_pccycles , store_pccycles );
175
- static SYSDEV_ATTR (pcenable , 0600 , show_pcenable , store_pcenable );
170
+ static DEVICE_ATTR (pc0event , 0600 , show_pc0event , store_pc0event );
171
+ static DEVICE_ATTR (pc0count , 0600 , show_pc0count , store_pc0count );
172
+ static DEVICE_ATTR (pc1event , 0600 , show_pc1event , store_pc1event );
173
+ static DEVICE_ATTR (pc1count , 0600 , show_pc1count , store_pc1count );
174
+ static DEVICE_ATTR (pccycles , 0600 , show_pccycles , store_pccycles );
175
+ static DEVICE_ATTR (pcenable , 0600 , show_pcenable , store_pcenable );
176
176
177
177
#endif /* CONFIG_PERFORMANCE_COUNTERS */
178
178
@@ -186,12 +186,12 @@ static int __init topology_init(void)
186
186
register_cpu (c , cpu );
187
187
188
188
#ifdef CONFIG_PERFORMANCE_COUNTERS
189
- sysdev_create_file (& c -> sysdev , & attr_pc0event );
190
- sysdev_create_file (& c -> sysdev , & attr_pc0count );
191
- sysdev_create_file (& c -> sysdev , & attr_pc1event );
192
- sysdev_create_file (& c -> sysdev , & attr_pc1count );
193
- sysdev_create_file (& c -> sysdev , & attr_pccycles );
194
- sysdev_create_file (& c -> sysdev , & attr_pcenable );
189
+ device_create_file (& c -> dev , & dev_attr_pc0event );
190
+ device_create_file (& c -> dev , & dev_attr_pc0count );
191
+ device_create_file (& c -> dev , & dev_attr_pc1event );
192
+ device_create_file (& c -> dev , & dev_attr_pc1count );
193
+ device_create_file (& c -> dev , & dev_attr_pccycles );
194
+ device_create_file (& c -> dev , & dev_attr_pcenable );
195
195
#endif
196
196
}
197
197
0 commit comments