aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2016-11-18 10:24:41 -0500
committerGuenter Roeck <linux@roeck-us.net>2016-12-16 09:53:54 -0500
commitbb79036215e2ca9d7ef5bd1461981396989c40da (patch)
treef4b91dfb43da997c8d9baeb344566603f0994733
parent31ecad65b011d64dfc80cab7c968078171aa2642 (diff)
intel-mid_wdt: Error code is just an integer
Error code when printed is more readable if it's represented as plain decimal integer. Otherwise user will see something like intel_mid_wdt: Error stopping watchdog: 0xffffffed which is not quite understandable ("Should I interpret it as a bitfield?"). Make it clear to use plaint integer specifier. While here, move struct device *dev local variable definition to the top of functions. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/watchdog/intel-mid_wdt.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/watchdog/intel-mid_wdt.c b/drivers/watchdog/intel-mid_wdt.c
index ff099a36d0c8..a4b729259b12 100644
--- a/drivers/watchdog/intel-mid_wdt.c
+++ b/drivers/watchdog/intel-mid_wdt.c
@@ -43,6 +43,7 @@ static inline int wdt_command(int sub, u32 *in, int inlen)
43 43
44static int wdt_start(struct watchdog_device *wd) 44static int wdt_start(struct watchdog_device *wd)
45{ 45{
46 struct device *dev = watchdog_get_drvdata(wd);
46 int ret, in_size; 47 int ret, in_size;
47 int timeout = wd->timeout; 48 int timeout = wd->timeout;
48 struct ipc_wd_start { 49 struct ipc_wd_start {
@@ -57,36 +58,32 @@ static int wdt_start(struct watchdog_device *wd)
57 in_size = DIV_ROUND_UP(sizeof(ipc_wd_start), 4); 58 in_size = DIV_ROUND_UP(sizeof(ipc_wd_start), 4);
58 59
59 ret = wdt_command(SCU_WATCHDOG_START, (u32 *)&ipc_wd_start, in_size); 60 ret = wdt_command(SCU_WATCHDOG_START, (u32 *)&ipc_wd_start, in_size);
60 if (ret) { 61 if (ret)
61 struct device *dev = watchdog_get_drvdata(wd);
62 dev_crit(dev, "error starting watchdog: %d\n", ret); 62 dev_crit(dev, "error starting watchdog: %d\n", ret);
63 }
64 63
65 return ret; 64 return ret;
66} 65}
67 66
68static int wdt_ping(struct watchdog_device *wd) 67static int wdt_ping(struct watchdog_device *wd)
69{ 68{
69 struct device *dev = watchdog_get_drvdata(wd);
70 int ret; 70 int ret;
71 71
72 ret = wdt_command(SCU_WATCHDOG_KEEPALIVE, NULL, 0); 72 ret = wdt_command(SCU_WATCHDOG_KEEPALIVE, NULL, 0);
73 if (ret) { 73 if (ret)
74 struct device *dev = watchdog_get_drvdata(wd); 74 dev_crit(dev, "Error executing keepalive: %d\n", ret);
75 dev_crit(dev, "Error executing keepalive: 0x%x\n", ret);
76 }
77 75
78 return ret; 76 return ret;
79} 77}
80 78
81static int wdt_stop(struct watchdog_device *wd) 79static int wdt_stop(struct watchdog_device *wd)
82{ 80{
81 struct device *dev = watchdog_get_drvdata(wd);
83 int ret; 82 int ret;
84 83
85 ret = wdt_command(SCU_WATCHDOG_STOP, NULL, 0); 84 ret = wdt_command(SCU_WATCHDOG_STOP, NULL, 0);
86 if (ret) { 85 if (ret)
87 struct device *dev = watchdog_get_drvdata(wd); 86 dev_crit(dev, "Error stopping watchdog: %d\n", ret);
88 dev_crit(dev, "Error stopping watchdog: 0x%x\n", ret);
89 }
90 87
91 return ret; 88 return ret;
92} 89}