@@ -52,7 +52,7 @@ static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr,
52
52
}
53
53
54
54
static ssize_t data_read (struct file * filep , struct kobject * kobj ,
55
- struct bin_attribute * attr , char * buf , loff_t off ,
55
+ const struct bin_attribute * attr , char * buf , loff_t off ,
56
56
size_t count )
57
57
{
58
58
char * data ;
@@ -85,7 +85,7 @@ static ssize_t data_read(struct file *filep, struct kobject *kobj,
85
85
}
86
86
87
87
static ssize_t update_write (struct file * filep , struct kobject * kobj ,
88
- struct bin_attribute * attr , char * buf , loff_t off ,
88
+ const struct bin_attribute * attr , char * buf , loff_t off ,
89
89
size_t count )
90
90
{
91
91
int rc ;
@@ -104,11 +104,11 @@ static struct kobj_attribute format_attr = __ATTR_RO(format);
104
104
105
105
static struct kobj_attribute size_attr = __ATTR_RO (size );
106
106
107
- static struct bin_attribute data_attr = __BIN_ATTR_RO (data , 0 );
107
+ static struct bin_attribute data_attr __ro_after_init = __BIN_ATTR_RO (data , 0 );
108
108
109
- static struct bin_attribute update_attr = __BIN_ATTR_WO (update , 0 );
109
+ static struct bin_attribute update_attr __ro_after_init = __BIN_ATTR_WO (update , 0 );
110
110
111
- static struct bin_attribute * secvar_bin_attrs [] = {
111
+ static const struct bin_attribute * const secvar_bin_attrs [] = {
112
112
& data_attr ,
113
113
& update_attr ,
114
114
NULL ,
@@ -121,7 +121,7 @@ static struct attribute *secvar_attrs[] = {
121
121
122
122
static const struct attribute_group secvar_attr_group = {
123
123
.attrs = secvar_attrs ,
124
- .bin_attrs = secvar_bin_attrs ,
124
+ .bin_attrs_new = secvar_bin_attrs ,
125
125
};
126
126
__ATTRIBUTE_GROUPS (secvar_attr );
127
127
@@ -130,7 +130,7 @@ static const struct kobj_type secvar_ktype = {
130
130
.default_groups = secvar_attr_groups ,
131
131
};
132
132
133
- static int update_kobj_size (void )
133
+ static __init int update_kobj_size (void )
134
134
{
135
135
136
136
u64 varsize ;
@@ -145,7 +145,7 @@ static int update_kobj_size(void)
145
145
return 0 ;
146
146
}
147
147
148
- static int secvar_sysfs_config (struct kobject * kobj )
148
+ static __init int secvar_sysfs_config (struct kobject * kobj )
149
149
{
150
150
struct attribute_group config_group = {
151
151
.name = "config" ,
@@ -158,7 +158,7 @@ static int secvar_sysfs_config(struct kobject *kobj)
158
158
return 0 ;
159
159
}
160
160
161
- static int add_var (const char * name )
161
+ static __init int add_var (const char * name )
162
162
{
163
163
struct kobject * kobj ;
164
164
int rc ;
@@ -181,7 +181,7 @@ static int add_var(const char *name)
181
181
return 0 ;
182
182
}
183
183
184
- static int secvar_sysfs_load (void )
184
+ static __init int secvar_sysfs_load (void )
185
185
{
186
186
u64 namesize = 0 ;
187
187
char * name ;
@@ -209,7 +209,7 @@ static int secvar_sysfs_load(void)
209
209
return rc ;
210
210
}
211
211
212
- static int secvar_sysfs_load_static (void )
212
+ static __init int secvar_sysfs_load_static (void )
213
213
{
214
214
const char * const * name_ptr = secvar_ops -> var_names ;
215
215
int rc ;
@@ -224,7 +224,7 @@ static int secvar_sysfs_load_static(void)
224
224
return 0 ;
225
225
}
226
226
227
- static int secvar_sysfs_init (void )
227
+ static __init int secvar_sysfs_init (void )
228
228
{
229
229
u64 max_size ;
230
230
int rc ;
0 commit comments