hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/watchdog/intel_scu_watchdog.c
....@@ -1,31 +1,15 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Intel_SCU 0.2: An Intel SCU IOH Based Watchdog Device
34 * for Intel part #(s):
45 * - AF82MP20 PCH
56 *
67 * Copyright (C) 2009-2010 Intel Corporation. All rights reserved.
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of version 2 of the GNU General
10
- * Public License as published by the Free Software Foundation.
11
- *
12
- * This program is distributed in the hope that it will be
13
- * useful, but WITHOUT ANY WARRANTY; without even the implied
14
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15
- * PURPOSE. See the GNU General Public License for more details.
16
- * You should have received a copy of the GNU General Public
17
- * License along with this program; if not, write to the Free
18
- * Software Foundation, Inc., 59 Temple Place - Suite 330,
19
- * Boston, MA 02111-1307, USA.
20
- * The full GNU General Public License is included in this
21
- * distribution in the file called COPYING.
22
- *
238 */
249
2510 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2611
2712 #include <linux/compiler.h>
28
-#include <linux/module.h>
2913 #include <linux/kernel.h>
3014 #include <linux/moduleparam.h>
3115 #include <linux/types.h>
....@@ -224,7 +208,7 @@
224208 watchdog_device.timer_tbl_ptr->freq_hz);
225209 pr_debug("set_heartbeat: timer_set is %x (hex)\n",
226210 watchdog_device.timer_set);
227
- pr_debug("set_hearbeat: timer_margin is %x (hex)\n", timer_margin);
211
+ pr_debug("set_heartbeat: timer_margin is %x (hex)\n", timer_margin);
228212 pr_debug("set_heartbeat: threshold is %x (hex)\n",
229213 watchdog_device.threshold);
230214 pr_debug("set_heartbeat: soft_threshold is %x (hex)\n",
....@@ -304,7 +288,7 @@
304288 if (watchdog_device.driver_closed)
305289 return -EPERM;
306290
307
- return nonseekable_open(inode, file);
291
+ return stream_open(inode, file);
308292 }
309293
310294 static int intel_scu_release(struct inode *inode, struct file *file)
....@@ -428,6 +412,7 @@
428412 .llseek = no_llseek,
429413 .write = intel_scu_write,
430414 .unlocked_ioctl = intel_scu_ioctl,
415
+ .compat_ioctl = compat_ptr_ioctl,
431416 .open = intel_scu_open,
432417 .release = intel_scu_release,
433418 };
....@@ -478,7 +463,7 @@
478463 return -ENODEV;
479464 }
480465
481
- tmp_addr = ioremap_nocache(watchdog_device.timer_tbl_ptr->phys_addr,
466
+ tmp_addr = ioremap(watchdog_device.timer_tbl_ptr->phys_addr,
482467 20);
483468
484469 if (tmp_addr == NULL) {
....@@ -545,21 +530,4 @@
545530 iounmap(watchdog_device.timer_load_count_addr);
546531 return ret;
547532 }
548
-
549
-static void __exit intel_scu_watchdog_exit(void)
550
-{
551
-
552
- misc_deregister(&watchdog_device.miscdev);
553
- unregister_reboot_notifier(&watchdog_device.intel_scu_notifier);
554
- /* disable the timer */
555
- iowrite32(0x00000002, watchdog_device.timer_control_addr);
556
- iounmap(watchdog_device.timer_load_count_addr);
557
-}
558
-
559533 late_initcall(intel_scu_watchdog_init);
560
-module_exit(intel_scu_watchdog_exit);
561
-
562
-MODULE_AUTHOR("Intel Corporation");
563
-MODULE_DESCRIPTION("Intel SCU Watchdog Device Driver");
564
-MODULE_LICENSE("GPL");
565
-MODULE_VERSION(WDT_VER);