Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Copyright (C) 2015-2016 Mentor Graphics
0004  */
0005 
0006 #include <linux/module.h>
0007 #include <linux/printk.h>
0008 #include <linux/watchdog.h>
0009 
0010 #include "watchdog_pretimeout.h"
0011 
0012 /**
0013  * pretimeout_noop - No operation on watchdog pretimeout event
0014  * @wdd - watchdog_device
0015  *
0016  * This function prints a message about pretimeout to kernel log.
0017  */
0018 static void pretimeout_noop(struct watchdog_device *wdd)
0019 {
0020     pr_alert("watchdog%d: pretimeout event\n", wdd->id);
0021 }
0022 
0023 static struct watchdog_governor watchdog_gov_noop = {
0024     .name       = "noop",
0025     .pretimeout = pretimeout_noop,
0026 };
0027 
0028 static int __init watchdog_gov_noop_register(void)
0029 {
0030     return watchdog_register_governor(&watchdog_gov_noop);
0031 }
0032 
0033 static void __exit watchdog_gov_noop_unregister(void)
0034 {
0035     watchdog_unregister_governor(&watchdog_gov_noop);
0036 }
0037 module_init(watchdog_gov_noop_register);
0038 module_exit(watchdog_gov_noop_unregister);
0039 
0040 MODULE_AUTHOR("Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>");
0041 MODULE_DESCRIPTION("Panic watchdog pretimeout governor");
0042 MODULE_LICENSE("GPL");