.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Intel Atom E6xx Watchdog driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2011 Alexander Stein |
---|
5 | 6 | * <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 | | - * |
---|
22 | 7 | */ |
---|
23 | 8 | |
---|
24 | 9 | #include <linux/module.h> |
---|
.. | .. |
---|
81 | 66 | |
---|
82 | 67 | static struct { |
---|
83 | 68 | unsigned short sch_wdtba; |
---|
84 | | - struct spinlock unlock_sequence; |
---|
| 69 | + spinlock_t unlock_sequence; |
---|
85 | 70 | #ifdef CONFIG_DEBUG_FS |
---|
86 | 71 | struct dentry *debugfs; |
---|
87 | 72 | #endif |
---|
.. | .. |
---|
193 | 178 | |
---|
194 | 179 | #ifdef CONFIG_DEBUG_FS |
---|
195 | 180 | |
---|
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) |
---|
197 | 182 | { |
---|
198 | 183 | seq_printf(s, "PV1 = 0x%08x\n", |
---|
199 | 184 | inl(ie6xx_wdt_data.sch_wdtba + PV1)); |
---|
.. | .. |
---|
212 | 197 | return 0; |
---|
213 | 198 | } |
---|
214 | 199 | |
---|
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); |
---|
226 | 201 | |
---|
227 | 202 | static void ie6xx_wdt_debugfs_init(void) |
---|
228 | 203 | { |
---|
229 | 204 | /* /sys/kernel/debug/ie6xx_wdt */ |
---|
230 | 205 | 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); |
---|
232 | 207 | } |
---|
233 | 208 | |
---|
234 | 209 | static void ie6xx_wdt_debugfs_exit(void) |
---|
.. | .. |
---|
279 | 254 | ie6xx_wdt_debugfs_init(); |
---|
280 | 255 | |
---|
281 | 256 | 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) |
---|
286 | 258 | goto misc_register_error; |
---|
287 | | - } |
---|
288 | 259 | |
---|
289 | 260 | return 0; |
---|
290 | 261 | |
---|