Source
38
38
{
39
39
struct nubus_rsrc *fres;
40
40
41
41
for_each_func_rsrc(fres)
42
42
seq_printf(m, "%x\t%04x %04x %04x %04x\t%08lx\n",
43
43
fres->board->slot, fres->category, fres->type,
44
44
fres->dr_sw, fres->dr_hw, fres->board->slot_addr);
45
45
return 0;
46
46
}
47
47
48
-
static int nubus_devices_proc_open(struct inode *inode, struct file *file)
49
-
{
50
-
return single_open(file, nubus_devices_proc_show, NULL);
51
-
}
52
-
53
-
static const struct file_operations nubus_devices_proc_fops = {
54
-
.open = nubus_devices_proc_open,
55
-
.read = seq_read,
56
-
.llseek = seq_lseek,
57
-
.release = single_release,
58
-
};
59
-
60
48
static struct proc_dir_entry *proc_bus_nubus_dir;
61
49
62
50
/*
63
51
* /proc/bus/nubus/x/ stuff
64
52
*/
65
53
66
54
struct proc_dir_entry *nubus_proc_add_board(struct nubus_board *board)
67
55
{
68
56
char name[2];
69
57
142
130
} else {
143
131
unsigned int data = (unsigned int)pde_data->res_ptr;
144
132
145
133
seq_putc(m, data >> 16);
146
134
seq_putc(m, data >> 8);
147
135
seq_putc(m, data >> 0);
148
136
}
149
137
return 0;
150
138
}
151
139
152
-
static int nubus_proc_rsrc_open(struct inode *inode, struct file *file)
153
-
{
154
-
return single_open(file, nubus_proc_rsrc_show, inode);
155
-
}
156
-
157
-
static const struct file_operations nubus_proc_rsrc_fops = {
158
-
.open = nubus_proc_rsrc_open,
159
-
.read = seq_read,
160
-
.llseek = seq_lseek,
161
-
.release = single_release,
162
-
};
163
-
164
140
void nubus_proc_add_rsrc_mem(struct proc_dir_entry *procdir,
165
141
const struct nubus_dirent *ent,
166
142
unsigned int size)
167
143
{
168
144
char name[9];
169
145
struct nubus_proc_pde_data *pde_data;
170
146
171
147
if (!procdir)
172
148
return;
173
149
174
150
snprintf(name, sizeof(name), "%x", ent->type);
175
151
if (size)
176
152
pde_data = nubus_proc_alloc_pde_data(nubus_dirptr(ent), size);
177
153
else
178
154
pde_data = NULL;
179
-
proc_create_data(name, S_IFREG | 0444, procdir,
180
-
&nubus_proc_rsrc_fops, pde_data);
155
+
proc_create_single_data(name, S_IFREG | 0444, procdir,
156
+
nubus_proc_rsrc_show, pde_data);
181
157
}
182
158
183
159
void nubus_proc_add_rsrc(struct proc_dir_entry *procdir,
184
160
const struct nubus_dirent *ent)
185
161
{
186
162
char name[9];
187
163
unsigned char *data = (unsigned char *)ent->data;
188
164
189
165
if (!procdir)
190
166
return;
191
167
192
168
snprintf(name, sizeof(name), "%x", ent->type);
193
-
proc_create_data(name, S_IFREG | 0444, procdir,
194
-
&nubus_proc_rsrc_fops,
195
-
nubus_proc_alloc_pde_data(data, 0));
169
+
proc_create_single_data(name, S_IFREG | 0444, procdir,
170
+
nubus_proc_rsrc_show,
171
+
nubus_proc_alloc_pde_data(data, 0));
196
172
}
197
173
198
174
/*
199
175
* /proc/nubus stuff
200
176
*/
201
177
202
-
static int nubus_proc_open(struct inode *inode, struct file *file)
203
-
{
204
-
return single_open(file, nubus_proc_show, NULL);
205
-
}
206
-
207
-
static const struct file_operations nubus_proc_fops = {
208
-
.open = nubus_proc_open,
209
-
.read = seq_read,
210
-
.llseek = seq_lseek,
211
-
.release = single_release,
212
-
};
213
-
214
178
void __init nubus_proc_init(void)
215
179
{
216
-
proc_create("nubus", 0, NULL, &nubus_proc_fops);
180
+
proc_create_single("nubus", 0, NULL, nubus_proc_show);
217
181
proc_bus_nubus_dir = proc_mkdir("bus/nubus", NULL);
218
182
if (!proc_bus_nubus_dir)
219
183
return;
220
-
proc_create("devices", 0, proc_bus_nubus_dir, &nubus_devices_proc_fops);
184
+
proc_create_single("devices", 0, proc_bus_nubus_dir,
185
+
nubus_devices_proc_show);
221
186
}