hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/watchdog/ie6xx_wdt.c
....@@ -1,24 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Intel Atom E6xx Watchdog driver
34 *
45 * Copyright (C) 2011 Alexander Stein
56 * <alexander.stein@systec-electronic.com>
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of version 2 of the GNU General
9
- * Public License as published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be
12
- * useful, but WITHOUT ANY WARRANTY; without even the implied
13
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
- * PURPOSE. See the GNU General Public License for more details.
15
- * You should have received a copy of the GNU General Public
16
- * License along with this program; if not, write to the Free
17
- * Software Foundation, Inc., 59 Temple Place - Suite 330,
18
- * Boston, MA 02111-1307, USA.
19
- * The full GNU General Public License is included in this
20
- * distribution in the file called COPYING.
21
- *
227 */
238
249 #include <linux/module.h>
....@@ -81,7 +66,7 @@
8166
8267 static struct {
8368 unsigned short sch_wdtba;
84
- struct spinlock unlock_sequence;
69
+ spinlock_t unlock_sequence;
8570 #ifdef CONFIG_DEBUG_FS
8671 struct dentry *debugfs;
8772 #endif
....@@ -193,7 +178,7 @@
193178
194179 #ifdef CONFIG_DEBUG_FS
195180
196
-static int ie6xx_wdt_dbg_show(struct seq_file *s, void *unused)
181
+static int ie6xx_wdt_show(struct seq_file *s, void *unused)
197182 {
198183 seq_printf(s, "PV1 = 0x%08x\n",
199184 inl(ie6xx_wdt_data.sch_wdtba + PV1));
....@@ -212,23 +197,13 @@
212197 return 0;
213198 }
214199
215
-static int ie6xx_wdt_dbg_open(struct inode *inode, struct file *file)
216
-{
217
- return single_open(file, ie6xx_wdt_dbg_show, NULL);
218
-}
219
-
220
-static const struct file_operations ie6xx_wdt_dbg_operations = {
221
- .open = ie6xx_wdt_dbg_open,
222
- .read = seq_read,
223
- .llseek = seq_lseek,
224
- .release = single_release,
225
-};
200
+DEFINE_SHOW_ATTRIBUTE(ie6xx_wdt);
226201
227202 static void ie6xx_wdt_debugfs_init(void)
228203 {
229204 /* /sys/kernel/debug/ie6xx_wdt */
230205 ie6xx_wdt_data.debugfs = debugfs_create_file("ie6xx_wdt",
231
- S_IFREG | S_IRUGO, NULL, NULL, &ie6xx_wdt_dbg_operations);
206
+ S_IFREG | S_IRUGO, NULL, NULL, &ie6xx_wdt_fops);
232207 }
233208
234209 static void ie6xx_wdt_debugfs_exit(void)
....@@ -279,12 +254,8 @@
279254 ie6xx_wdt_debugfs_init();
280255
281256 ret = watchdog_register_device(&ie6xx_wdt_dev);
282
- if (ret) {
283
- dev_err(&pdev->dev,
284
- "Watchdog timer: cannot register device (err =%d)\n",
285
- ret);
257
+ if (ret)
286258 goto misc_register_error;
287
- }
288259
289260 return 0;
290261