| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | #include <linux/kernel.h> |
|---|
| 2 | 3 | #include <linux/module.h> |
|---|
| 3 | 4 | #include <linux/init.h> |
|---|
| .. | .. |
|---|
| 49 | 50 | add_timer(&led_blink_timer); |
|---|
| 50 | 51 | } |
|---|
| 51 | 52 | |
|---|
| 53 | +#ifdef CONFIG_PROC_FS |
|---|
| 52 | 54 | static int led_proc_show(struct seq_file *m, void *v) |
|---|
| 53 | 55 | { |
|---|
| 54 | 56 | if (get_auxio() & AUXIO_LED) |
|---|
| .. | .. |
|---|
| 103 | 105 | return count; |
|---|
| 104 | 106 | } |
|---|
| 105 | 107 | |
|---|
| 106 | | -static const struct file_operations led_proc_fops = { |
|---|
| 107 | | - .owner = THIS_MODULE, |
|---|
| 108 | | - .open = led_proc_open, |
|---|
| 109 | | - .read = seq_read, |
|---|
| 110 | | - .llseek = seq_lseek, |
|---|
| 111 | | - .release = single_release, |
|---|
| 112 | | - .write = led_proc_write, |
|---|
| 108 | +static const struct proc_ops led_proc_ops = { |
|---|
| 109 | + .proc_open = led_proc_open, |
|---|
| 110 | + .proc_read = seq_read, |
|---|
| 111 | + .proc_lseek = seq_lseek, |
|---|
| 112 | + .proc_release = single_release, |
|---|
| 113 | + .proc_write = led_proc_write, |
|---|
| 113 | 114 | }; |
|---|
| 115 | +#endif |
|---|
| 114 | 116 | |
|---|
| 115 | 117 | static struct proc_dir_entry *led; |
|---|
| 116 | 118 | |
|---|
| .. | .. |
|---|
| 120 | 122 | { |
|---|
| 121 | 123 | timer_setup(&led_blink_timer, led_blink, 0); |
|---|
| 122 | 124 | |
|---|
| 123 | | - led = proc_create("led", 0, NULL, &led_proc_fops); |
|---|
| 125 | + led = proc_create("led", 0, NULL, &led_proc_ops); |
|---|
| 124 | 126 | if (!led) |
|---|
| 125 | 127 | return -ENOMEM; |
|---|
| 126 | 128 | |
|---|