diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2013-01-12 12:14:09 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2013-03-01 06:47:19 -0500 |
commit | a39068929a9a7c418c569c6d22990953b4f75df7 (patch) | |
tree | a95600fb8d22205d9474f0b80757ef088ecca9a8 | |
parent | f82dedf812ecdf0c19c6c240e85a4a487ab62016 (diff) |
watchdog: bcm47xx_wdt.c: rename ops methods
Rename the methods registered to struct watchdog_ops bcm47xx_wdt_ops in
order to add an other struct watchdog_ops using different ops in the
next patch.
Also rename WDT_MAX_TIME to WDT_SOFTTIMER_MAX.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
-rw-r--r-- | drivers/watchdog/bcm47xx_wdt.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c index 97ccfce0dabb..5a13e43784d3 100644 --- a/drivers/watchdog/bcm47xx_wdt.c +++ b/drivers/watchdog/bcm47xx_wdt.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #define DRV_NAME "bcm47xx_wdt" | 30 | #define DRV_NAME "bcm47xx_wdt" |
31 | 31 | ||
32 | #define WDT_DEFAULT_TIME 30 /* seconds */ | 32 | #define WDT_DEFAULT_TIME 30 /* seconds */ |
33 | #define WDT_MAX_TIME 255 /* seconds */ | 33 | #define WDT_SOFTTIMER_MAX 255 /* seconds */ |
34 | 34 | ||
35 | static int wdt_time = WDT_DEFAULT_TIME; | 35 | static int wdt_time = WDT_DEFAULT_TIME; |
36 | static bool nowayout = WATCHDOG_NOWAYOUT; | 36 | static bool nowayout = WATCHDOG_NOWAYOUT; |
@@ -49,7 +49,7 @@ static inline struct bcm47xx_wdt *bcm47xx_wdt_get(struct watchdog_device *wdd) | |||
49 | return container_of(wdd, struct bcm47xx_wdt, wdd); | 49 | return container_of(wdd, struct bcm47xx_wdt, wdd); |
50 | } | 50 | } |
51 | 51 | ||
52 | static void bcm47xx_timer_tick(unsigned long data) | 52 | static void bcm47xx_wdt_soft_timer_tick(unsigned long data) |
53 | { | 53 | { |
54 | struct bcm47xx_wdt *wdt = (struct bcm47xx_wdt *)data; | 54 | struct bcm47xx_wdt *wdt = (struct bcm47xx_wdt *)data; |
55 | u32 next_tick = min(wdt->wdd.timeout * 1000, wdt->max_timer_ms); | 55 | u32 next_tick = min(wdt->wdd.timeout * 1000, wdt->max_timer_ms); |
@@ -62,7 +62,7 @@ static void bcm47xx_timer_tick(unsigned long data) | |||
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | static int bcm47xx_wdt_keepalive(struct watchdog_device *wdd) | 65 | static int bcm47xx_wdt_soft_keepalive(struct watchdog_device *wdd) |
66 | { | 66 | { |
67 | struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); | 67 | struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); |
68 | 68 | ||
@@ -71,17 +71,17 @@ static int bcm47xx_wdt_keepalive(struct watchdog_device *wdd) | |||
71 | return 0; | 71 | return 0; |
72 | } | 72 | } |
73 | 73 | ||
74 | static int bcm47xx_wdt_start(struct watchdog_device *wdd) | 74 | static int bcm47xx_wdt_soft_start(struct watchdog_device *wdd) |
75 | { | 75 | { |
76 | struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); | 76 | struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); |
77 | 77 | ||
78 | bcm47xx_wdt_keepalive(wdd); | 78 | bcm47xx_wdt_soft_keepalive(wdd); |
79 | bcm47xx_timer_tick((unsigned long)wdt); | 79 | bcm47xx_wdt_soft_timer_tick((unsigned long)wdt); |
80 | 80 | ||
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
83 | 83 | ||
84 | static int bcm47xx_wdt_stop(struct watchdog_device *wdd) | 84 | static int bcm47xx_wdt_soft_stop(struct watchdog_device *wdd) |
85 | { | 85 | { |
86 | struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); | 86 | struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); |
87 | 87 | ||
@@ -91,12 +91,12 @@ static int bcm47xx_wdt_stop(struct watchdog_device *wdd) | |||
91 | return 0; | 91 | return 0; |
92 | } | 92 | } |
93 | 93 | ||
94 | static int bcm47xx_wdt_set_timeout(struct watchdog_device *wdd, | 94 | static int bcm47xx_wdt_soft_set_timeout(struct watchdog_device *wdd, |
95 | unsigned int new_time) | 95 | unsigned int new_time) |
96 | { | 96 | { |
97 | if (new_time < 1 || new_time > WDT_MAX_TIME) { | 97 | if (new_time < 1 || new_time > WDT_SOFTTIMER_MAX) { |
98 | pr_warn("timeout value must be 1<=x<=%d, using %d\n", | 98 | pr_warn("timeout value must be 1<=x<=%d, using %d\n", |
99 | WDT_MAX_TIME, new_time); | 99 | WDT_SOFTTIMER_MAX, new_time); |
100 | return -EINVAL; | 100 | return -EINVAL; |
101 | } | 101 | } |
102 | 102 | ||
@@ -122,12 +122,12 @@ static int bcm47xx_wdt_notify_sys(struct notifier_block *this, | |||
122 | return NOTIFY_DONE; | 122 | return NOTIFY_DONE; |
123 | } | 123 | } |
124 | 124 | ||
125 | static struct watchdog_ops bcm47xx_wdt_ops = { | 125 | static struct watchdog_ops bcm47xx_wdt_soft_ops = { |
126 | .owner = THIS_MODULE, | 126 | .owner = THIS_MODULE, |
127 | .start = bcm47xx_wdt_start, | 127 | .start = bcm47xx_wdt_soft_start, |
128 | .stop = bcm47xx_wdt_stop, | 128 | .stop = bcm47xx_wdt_soft_stop, |
129 | .ping = bcm47xx_wdt_keepalive, | 129 | .ping = bcm47xx_wdt_soft_keepalive, |
130 | .set_timeout = bcm47xx_wdt_set_timeout, | 130 | .set_timeout = bcm47xx_wdt_soft_set_timeout, |
131 | }; | 131 | }; |
132 | 132 | ||
133 | static int bcm47xx_wdt_probe(struct platform_device *pdev) | 133 | static int bcm47xx_wdt_probe(struct platform_device *pdev) |
@@ -138,10 +138,10 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev) | |||
138 | if (!wdt) | 138 | if (!wdt) |
139 | return -ENXIO; | 139 | return -ENXIO; |
140 | 140 | ||
141 | setup_timer(&wdt->soft_timer, bcm47xx_timer_tick, | 141 | setup_timer(&wdt->soft_timer, bcm47xx_wdt_soft_timer_tick, |
142 | (long unsigned int)wdt); | 142 | (long unsigned int)wdt); |
143 | 143 | ||
144 | wdt->wdd.ops = &bcm47xx_wdt_ops; | 144 | wdt->wdd.ops = &bcm47xx_wdt_soft_ops; |
145 | wdt->wdd.info = &bcm47xx_wdt_info; | 145 | wdt->wdd.info = &bcm47xx_wdt_info; |
146 | wdt->wdd.timeout = WDT_DEFAULT_TIME; | 146 | wdt->wdd.timeout = WDT_DEFAULT_TIME; |
147 | ret = wdt->wdd.ops->set_timeout(&wdt->wdd, timeout); | 147 | ret = wdt->wdd.ops->set_timeout(&wdt->wdd, timeout); |