diff options
author | Krzysztof Kozlowski <krzk@kernel.org> | 2017-02-24 16:07:40 -0500 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2017-02-24 17:00:23 -0500 |
commit | 456f53d652411594249efc3fcea01842177c9a6f (patch) | |
tree | 0e71ebc4e3b7680bb49c2bf40ca2751942b0b819 /drivers/watchdog | |
parent | 0b445549ea6f91ffea78a976fe89b932db6e077a (diff) |
watchdog: s3c2410: Use dev_dbg instead of pr_info
Replace the 'debug' module parameter and pr_info() with proper device
dynamic debug calls because this is the preferred and flexible way of
enabling debugging printks.
Also remove some obvious debug printks.
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/s3c2410_wdt.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 558789b8805f..7e504ec1a3c3 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c | |||
@@ -23,8 +23,6 @@ | |||
23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
27 | |||
28 | #include <linux/module.h> | 26 | #include <linux/module.h> |
29 | #include <linux/moduleparam.h> | 27 | #include <linux/moduleparam.h> |
30 | #include <linux/types.h> | 28 | #include <linux/types.h> |
@@ -83,13 +81,11 @@ static bool nowayout = WATCHDOG_NOWAYOUT; | |||
83 | static int tmr_margin; | 81 | static int tmr_margin; |
84 | static int tmr_atboot = S3C2410_WATCHDOG_ATBOOT; | 82 | static int tmr_atboot = S3C2410_WATCHDOG_ATBOOT; |
85 | static int soft_noboot; | 83 | static int soft_noboot; |
86 | static int debug; | ||
87 | 84 | ||
88 | module_param(tmr_margin, int, 0); | 85 | module_param(tmr_margin, int, 0); |
89 | module_param(tmr_atboot, int, 0); | 86 | module_param(tmr_atboot, int, 0); |
90 | module_param(nowayout, bool, 0); | 87 | module_param(nowayout, bool, 0); |
91 | module_param(soft_noboot, int, 0); | 88 | module_param(soft_noboot, int, 0); |
92 | module_param(debug, int, 0); | ||
93 | 89 | ||
94 | MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. (default=" | 90 | MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. (default=" |
95 | __MODULE_STRING(S3C2410_WATCHDOG_DEFAULT_TIME) ")"); | 91 | __MODULE_STRING(S3C2410_WATCHDOG_DEFAULT_TIME) ")"); |
@@ -100,7 +96,6 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" | |||
100 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 96 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
101 | MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, " | 97 | MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, " |
102 | "0 to reboot (default 0)"); | 98 | "0 to reboot (default 0)"); |
103 | MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug (default 0)"); | ||
104 | 99 | ||
105 | /** | 100 | /** |
106 | * struct s3c2410_wdt_variant - Per-variant config data | 101 | * struct s3c2410_wdt_variant - Per-variant config data |
@@ -204,14 +199,6 @@ static const struct platform_device_id s3c2410_wdt_ids[] = { | |||
204 | }; | 199 | }; |
205 | MODULE_DEVICE_TABLE(platform, s3c2410_wdt_ids); | 200 | MODULE_DEVICE_TABLE(platform, s3c2410_wdt_ids); |
206 | 201 | ||
207 | /* watchdog control routines */ | ||
208 | |||
209 | #define DBG(fmt, ...) \ | ||
210 | do { \ | ||
211 | if (debug) \ | ||
212 | pr_info(fmt, ##__VA_ARGS__); \ | ||
213 | } while (0) | ||
214 | |||
215 | /* functions */ | 202 | /* functions */ |
216 | 203 | ||
217 | static inline unsigned int s3c2410wdt_max_timeout(struct clk *clock) | 204 | static inline unsigned int s3c2410wdt_max_timeout(struct clk *clock) |
@@ -307,8 +294,8 @@ static int s3c2410wdt_start(struct watchdog_device *wdd) | |||
307 | wtcon |= S3C2410_WTCON_RSTEN; | 294 | wtcon |= S3C2410_WTCON_RSTEN; |
308 | } | 295 | } |
309 | 296 | ||
310 | DBG("%s: count=0x%08x, wtcon=%08lx\n", | 297 | dev_dbg(wdt->dev, "Starting watchdog: count=0x%08x, wtcon=%08lx\n", |
311 | __func__, wdt->count, wtcon); | 298 | wdt->count, wtcon); |
312 | 299 | ||
313 | writel(wdt->count, wdt->reg_base + S3C2410_WTDAT); | 300 | writel(wdt->count, wdt->reg_base + S3C2410_WTDAT); |
314 | writel(wdt->count, wdt->reg_base + S3C2410_WTCNT); | 301 | writel(wdt->count, wdt->reg_base + S3C2410_WTCNT); |
@@ -337,8 +324,8 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned timeou | |||
337 | freq = DIV_ROUND_UP(freq, 128); | 324 | freq = DIV_ROUND_UP(freq, 128); |
338 | count = timeout * freq; | 325 | count = timeout * freq; |
339 | 326 | ||
340 | DBG("%s: count=%d, timeout=%d, freq=%lu\n", | 327 | dev_dbg(wdt->dev, "Heartbeat: count=%d, timeout=%d, freq=%lu\n", |
341 | __func__, count, timeout, freq); | 328 | count, timeout, freq); |
342 | 329 | ||
343 | /* if the count is bigger than the watchdog register, | 330 | /* if the count is bigger than the watchdog register, |
344 | then work out what we need to do (and if) we can | 331 | then work out what we need to do (and if) we can |
@@ -354,8 +341,8 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned timeou | |||
354 | } | 341 | } |
355 | } | 342 | } |
356 | 343 | ||
357 | DBG("%s: timeout=%d, divisor=%d, count=%d (%08x)\n", | 344 | dev_dbg(wdt->dev, "Heartbeat: timeout=%d, divisor=%d, count=%d (%08x)\n", |
358 | __func__, timeout, divisor, count, DIV_ROUND_UP(count, divisor)); | 345 | timeout, divisor, count, DIV_ROUND_UP(count, divisor)); |
359 | 346 | ||
360 | count = DIV_ROUND_UP(count, divisor); | 347 | count = DIV_ROUND_UP(count, divisor); |
361 | wdt->count = count; | 348 | wdt->count = count; |
@@ -544,8 +531,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev) | |||
544 | int started = 0; | 531 | int started = 0; |
545 | int ret; | 532 | int ret; |
546 | 533 | ||
547 | DBG("%s: probe=%p\n", __func__, pdev); | ||
548 | |||
549 | dev = &pdev->dev; | 534 | dev = &pdev->dev; |
550 | 535 | ||
551 | wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); | 536 | wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); |
@@ -581,8 +566,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev) | |||
581 | goto err; | 566 | goto err; |
582 | } | 567 | } |
583 | 568 | ||
584 | DBG("probe: mapped reg_base=%p\n", wdt->reg_base); | ||
585 | |||
586 | wdt->clock = devm_clk_get(dev, "watchdog"); | 569 | wdt->clock = devm_clk_get(dev, "watchdog"); |
587 | if (IS_ERR(wdt->clock)) { | 570 | if (IS_ERR(wdt->clock)) { |
588 | dev_err(dev, "failed to find watchdog clock source\n"); | 571 | dev_err(dev, "failed to find watchdog clock source\n"); |