hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/watchdog/kempld_wdt.c
....@@ -1,17 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Kontron PLD watchdog driver
34 *
45 * Copyright (c) 2010-2013 Kontron Europe GmbH
56 * Author: Michael Brunner <michael.brunner@kontron.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License 2 as published
9
- * by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
157 *
168 * Note: From the PLD watchdog point of view timeout and pretimeout are
179 * defined differently than in the kernel.
....@@ -467,7 +459,7 @@
467459 KEMPLD_WDT_CFG_GLOBAL_LOCK)) {
468460 if (!nowayout)
469461 dev_warn(dev,
470
- "Forcing nowayout - watchdog lock enabled!\n");
462
+ "Forcing nowayout - watchdog lock enabled!\n");
471463 nowayout = true;
472464 }
473465
....@@ -492,33 +484,15 @@
492484 }
493485
494486 platform_set_drvdata(pdev, wdt_data);
495
- ret = watchdog_register_device(wdd);
487
+ watchdog_stop_on_reboot(wdd);
488
+ watchdog_stop_on_unregister(wdd);
489
+ ret = devm_watchdog_register_device(dev, wdd);
496490 if (ret)
497491 return ret;
498492
499493 dev_info(dev, "Watchdog registered with %ds timeout\n", wdd->timeout);
500494
501495 return 0;
502
-}
503
-
504
-static void kempld_wdt_shutdown(struct platform_device *pdev)
505
-{
506
- struct kempld_wdt_data *wdt_data = platform_get_drvdata(pdev);
507
-
508
- kempld_wdt_stop(&wdt_data->wdd);
509
-}
510
-
511
-static int kempld_wdt_remove(struct platform_device *pdev)
512
-{
513
- struct kempld_wdt_data *wdt_data = platform_get_drvdata(pdev);
514
- struct watchdog_device *wdd = &wdt_data->wdd;
515
- int ret = 0;
516
-
517
- if (!nowayout)
518
- ret = kempld_wdt_stop(wdd);
519
- watchdog_unregister_device(wdd);
520
-
521
- return ret;
522496 }
523497
524498 #ifdef CONFIG_PM
....@@ -567,8 +541,6 @@
567541 .name = "kempld-wdt",
568542 },
569543 .probe = kempld_wdt_probe,
570
- .remove = kempld_wdt_remove,
571
- .shutdown = kempld_wdt_shutdown,
572544 .suspend = kempld_wdt_suspend,
573545 .resume = kempld_wdt_resume,
574546 };