hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/parisc/led.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Chassis LCD/LED driver for HP-PARISC workstations
34 *
....@@ -5,11 +6,6 @@
56 * (c) Copyright 2000 Helge Deller <hdeller@redhat.com>
67 * (c) Copyright 2001-2009 Helge Deller <deller@gmx.de>
78 * (c) Copyright 2001 Randolph Chung <tausq@debian.org>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
139 *
1410 * TODO:
1511 * - speed-up calculations with inlined assembler
....@@ -60,8 +56,8 @@
6056 static int led_type __read_mostly = -1;
6157 static unsigned char lastleds; /* LED state from most recent update */
6258 static unsigned int led_heartbeat __read_mostly = 1;
63
-static unsigned int led_diskio __read_mostly = 1;
64
-static unsigned int led_lanrxtx __read_mostly = 1;
59
+static unsigned int led_diskio __read_mostly;
60
+static unsigned int led_lanrxtx __read_mostly;
6561 static char lcd_text[32] __read_mostly;
6662 static char lcd_text_default[32] __read_mostly;
6763 static int lcd_no_led_support __read_mostly = 0; /* KittyHawk doesn't support LED on its LCD */
....@@ -141,6 +137,9 @@
141137
142138 /* Create the work queue and queue the LED task */
143139 led_wq = create_singlethread_workqueue("led_wq");
140
+ if (!led_wq)
141
+ return -ENOMEM;
142
+
144143 queue_delayed_work(led_wq, &led_task, 0);
145144
146145 return 0;
....@@ -234,13 +233,12 @@
234233 return -EINVAL;
235234 }
236235
237
-static const struct file_operations led_proc_fops = {
238
- .owner = THIS_MODULE,
239
- .open = led_proc_open,
240
- .read = seq_read,
241
- .llseek = seq_lseek,
242
- .release = single_release,
243
- .write = led_proc_write,
236
+static const struct proc_ops led_proc_ops = {
237
+ .proc_open = led_proc_open,
238
+ .proc_read = seq_read,
239
+ .proc_lseek = seq_lseek,
240
+ .proc_release = single_release,
241
+ .proc_write = led_proc_write,
244242 };
245243
246244 static int __init led_create_procfs(void)
....@@ -256,14 +254,14 @@
256254 if (!lcd_no_led_support)
257255 {
258256 ent = proc_create_data("led", S_IRUGO|S_IWUSR, proc_pdc_root,
259
- &led_proc_fops, (void *)LED_NOLCD); /* LED */
257
+ &led_proc_ops, (void *)LED_NOLCD); /* LED */
260258 if (!ent) return -1;
261259 }
262260
263261 if (led_type == LED_HASLCD)
264262 {
265263 ent = proc_create_data("lcd", S_IRUGO|S_IWUSR, proc_pdc_root,
266
- &led_proc_fops, (void *)LED_HASLCD); /* LCD */
264
+ &led_proc_ops, (void *)LED_HASLCD); /* LCD */
267265 if (!ent) return -1;
268266 }
269267