diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-04 13:00:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-04 13:00:01 -0400 |
commit | cf626b0da78df6669c6b5f51ddd9a70a0702e579 (patch) | |
tree | 45d29a4cb7574aed7f140814ed22088ded21c291 /drivers/acpi/button.c | |
parent | 9c50eafc32ddbd166c8a2bbaecd4ad201c452b14 (diff) | |
parent | 5ef03dbd91855544cd4c7c1910c3ef5226ee87e8 (diff) |
Merge branch 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull procfs updates from Al Viro:
"Christoph's proc_create_... cleanups series"
* 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (44 commits)
xfs, proc: hide unused xfs procfs helpers
isdn/gigaset: add back gigaset_procinfo assignment
proc: update SIZEOF_PDE_INLINE_NAME for the new pde fields
tty: replace ->proc_fops with ->proc_show
ide: replace ->proc_fops with ->proc_show
ide: remove ide_driver_proc_write
isdn: replace ->proc_fops with ->proc_show
atm: switch to proc_create_seq_private
atm: simplify procfs code
bluetooth: switch to proc_create_seq_data
netfilter/x_tables: switch to proc_create_seq_private
netfilter/xt_hashlimit: switch to proc_create_{seq,single}_data
neigh: switch to proc_create_seq_data
hostap: switch to proc_create_{seq,single}_data
bonding: switch to proc_create_seq_data
rtc/proc: switch to proc_create_single_data
drbd: switch to proc_create_single
resource: switch to proc_create_seq_data
staging/rtl8192u: simplify procfs code
jfs: simplify procfs code
...
Diffstat (limited to 'drivers/acpi/button.c')
-rw-r--r-- | drivers/acpi/button.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index f1cc4f9d31cd..2345a5ee2dbb 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -263,19 +263,6 @@ static int acpi_button_state_seq_show(struct seq_file *seq, void *offset) | |||
263 | return 0; | 263 | return 0; |
264 | } | 264 | } |
265 | 265 | ||
266 | static int acpi_button_state_open_fs(struct inode *inode, struct file *file) | ||
267 | { | ||
268 | return single_open(file, acpi_button_state_seq_show, PDE_DATA(inode)); | ||
269 | } | ||
270 | |||
271 | static const struct file_operations acpi_button_state_fops = { | ||
272 | .owner = THIS_MODULE, | ||
273 | .open = acpi_button_state_open_fs, | ||
274 | .read = seq_read, | ||
275 | .llseek = seq_lseek, | ||
276 | .release = single_release, | ||
277 | }; | ||
278 | |||
279 | static int acpi_button_add_fs(struct acpi_device *device) | 266 | static int acpi_button_add_fs(struct acpi_device *device) |
280 | { | 267 | { |
281 | struct acpi_button *button = acpi_driver_data(device); | 268 | struct acpi_button *button = acpi_driver_data(device); |
@@ -311,9 +298,9 @@ static int acpi_button_add_fs(struct acpi_device *device) | |||
311 | } | 298 | } |
312 | 299 | ||
313 | /* create /proc/acpi/button/lid/LID/state */ | 300 | /* create /proc/acpi/button/lid/LID/state */ |
314 | entry = proc_create_data(ACPI_BUTTON_FILE_STATE, | 301 | entry = proc_create_single_data(ACPI_BUTTON_FILE_STATE, S_IRUGO, |
315 | S_IRUGO, acpi_device_dir(device), | 302 | acpi_device_dir(device), acpi_button_state_seq_show, |
316 | &acpi_button_state_fops, device); | 303 | device); |
317 | if (!entry) { | 304 | if (!entry) { |
318 | ret = -ENODEV; | 305 | ret = -ENODEV; |
319 | goto remove_dev_dir; | 306 | goto remove_dev_dir; |