Skip to content

Commit 5bbecc5

Browse files
groeckWim Van Sebroeck
authored andcommitted
watchdog: sp5100_tco: Clean up function and variable names
Use more common function and variable names. Use pdev instead of dev for platform device. Use sp5100_tco_probe() instead of sp5100_tco_init() for the probe function. Drop sp5100_tco_cleanup(); just move the code into sp5100_tco_remove(). Use sp5100_tco_init() instead of sp5100_tco_init_module() for the module initialization function. Use sp5100_tco_exit() instead of sp5100_tco_cleanup_module() for the module exit function. Use consistent defines for accessing the watchdog control register. Cc: Zoltán Böszörményi <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent fd8f909 commit 5bbecc5

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

drivers/watchdog/sp5100_tco.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,8 @@ static int sp5100_tco_setupdevice(struct device *dev)
421421
* Save WatchDogFired status, because WatchDogFired flag is
422422
* cleared here.
423423
*/
424-
tco_wdt_fired = val & SP5100_PM_WATCHDOG_FIRED;
425-
val &= ~SP5100_PM_WATCHDOG_ACTION_RESET;
424+
tco_wdt_fired = val & SP5100_WDT_FIRED;
425+
val &= ~SP5100_WDT_ACTION_RESET;
426426
writel(val, SP5100_WDT_CONTROL(tcobase));
427427

428428
/* Set a reasonable heartbeat before we stop the timer */
@@ -445,7 +445,7 @@ static int sp5100_tco_setupdevice(struct device *dev)
445445
return ret;
446446
}
447447

448-
static int sp5100_tco_init(struct platform_device *pdev)
448+
static int sp5100_tco_probe(struct platform_device *pdev)
449449
{
450450
struct device *dev = &pdev->dev;
451451
int ret;
@@ -492,7 +492,7 @@ static int sp5100_tco_init(struct platform_device *pdev)
492492
return ret;
493493
}
494494

495-
static void sp5100_tco_cleanup(void)
495+
static int sp5100_tco_remove(struct platform_device *pdev)
496496
{
497497
/* Stop the timer before we leave */
498498
if (!nowayout)
@@ -502,22 +502,17 @@ static void sp5100_tco_cleanup(void)
502502
misc_deregister(&sp5100_tco_miscdev);
503503
iounmap(tcobase);
504504
release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE);
505-
}
506505

507-
static int sp5100_tco_remove(struct platform_device *dev)
508-
{
509-
if (tcobase)
510-
sp5100_tco_cleanup();
511506
return 0;
512507
}
513508

514-
static void sp5100_tco_shutdown(struct platform_device *dev)
509+
static void sp5100_tco_shutdown(struct platform_device *pdev)
515510
{
516511
tco_timer_stop();
517512
}
518513

519514
static struct platform_driver sp5100_tco_driver = {
520-
.probe = sp5100_tco_init,
515+
.probe = sp5100_tco_probe,
521516
.remove = sp5100_tco_remove,
522517
.shutdown = sp5100_tco_shutdown,
523518
.driver = {
@@ -544,7 +539,7 @@ static const struct pci_device_id sp5100_tco_pci_tbl[] = {
544539
};
545540
MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl);
546541

547-
static int __init sp5100_tco_init_module(void)
542+
static int __init sp5100_tco_init(void)
548543
{
549544
struct pci_dev *dev = NULL;
550545
int err;
@@ -580,14 +575,14 @@ static int __init sp5100_tco_init_module(void)
580575
return err;
581576
}
582577

583-
static void __exit sp5100_tco_cleanup_module(void)
578+
static void __exit sp5100_tco_exit(void)
584579
{
585580
platform_device_unregister(sp5100_tco_platform_device);
586581
platform_driver_unregister(&sp5100_tco_driver);
587582
}
588583

589-
module_init(sp5100_tco_init_module);
590-
module_exit(sp5100_tco_cleanup_module);
584+
module_init(sp5100_tco_init);
585+
module_exit(sp5100_tco_exit);
591586

592587
MODULE_AUTHOR("Priyanka Gupta");
593588
MODULE_DESCRIPTION("TCO timer driver for SP5100/SB800 chipset");

drivers/watchdog/sp5100_tco.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#define SP5100_WDT_COUNT(base) ((base) + 0x04) /* Watchdog Count */
1616

1717
#define SP5100_WDT_START_STOP_BIT (1 << 0)
18+
#define SP5100_WDT_FIRED (1 << 1)
19+
#define SP5100_WDT_ACTION_RESET (1 << 2)
1820
#define SP5100_WDT_TRIGGER_BIT (1 << 7)
1921

2022
#define SP5100_PM_IOPORTS_SIZE 0x02
@@ -34,9 +36,6 @@
3436
#define SP5100_PM_WATCHDOG_CONTROL 0x69
3537
#define SP5100_PM_WATCHDOG_BASE 0x6C
3638

37-
#define SP5100_PM_WATCHDOG_FIRED (1 << 1)
38-
#define SP5100_PM_WATCHDOG_ACTION_RESET (1 << 2)
39-
4039
#define SP5100_PCI_WATCHDOG_MISC_REG 0x41
4140
#define SP5100_PCI_WATCHDOG_DECODE_EN (1 << 3)
4241

0 commit comments

Comments
 (0)