| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Chassis LCD/LED driver for HP-PARISC workstations |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * (c) Copyright 2000 Helge Deller <hdeller@redhat.com> |
|---|
| 6 | 7 | * (c) Copyright 2001-2009 Helge Deller <deller@gmx.de> |
|---|
| 7 | 8 | * (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. |
|---|
| 13 | 9 | * |
|---|
| 14 | 10 | * TODO: |
|---|
| 15 | 11 | * - speed-up calculations with inlined assembler |
|---|
| .. | .. |
|---|
| 60 | 56 | static int led_type __read_mostly = -1; |
|---|
| 61 | 57 | static unsigned char lastleds; /* LED state from most recent update */ |
|---|
| 62 | 58 | 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; |
|---|
| 65 | 61 | static char lcd_text[32] __read_mostly; |
|---|
| 66 | 62 | static char lcd_text_default[32] __read_mostly; |
|---|
| 67 | 63 | static int lcd_no_led_support __read_mostly = 0; /* KittyHawk doesn't support LED on its LCD */ |
|---|
| .. | .. |
|---|
| 141 | 137 | |
|---|
| 142 | 138 | /* Create the work queue and queue the LED task */ |
|---|
| 143 | 139 | led_wq = create_singlethread_workqueue("led_wq"); |
|---|
| 140 | + if (!led_wq) |
|---|
| 141 | + return -ENOMEM; |
|---|
| 142 | + |
|---|
| 144 | 143 | queue_delayed_work(led_wq, &led_task, 0); |
|---|
| 145 | 144 | |
|---|
| 146 | 145 | return 0; |
|---|
| .. | .. |
|---|
| 234 | 233 | return -EINVAL; |
|---|
| 235 | 234 | } |
|---|
| 236 | 235 | |
|---|
| 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, |
|---|
| 244 | 242 | }; |
|---|
| 245 | 243 | |
|---|
| 246 | 244 | static int __init led_create_procfs(void) |
|---|
| .. | .. |
|---|
| 256 | 254 | if (!lcd_no_led_support) |
|---|
| 257 | 255 | { |
|---|
| 258 | 256 | 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 */ |
|---|
| 260 | 258 | if (!ent) return -1; |
|---|
| 261 | 259 | } |
|---|
| 262 | 260 | |
|---|
| 263 | 261 | if (led_type == LED_HASLCD) |
|---|
| 264 | 262 | { |
|---|
| 265 | 263 | 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 */ |
|---|
| 267 | 265 | if (!ent) return -1; |
|---|
| 268 | 266 | } |
|---|
| 269 | 267 | |
|---|