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>

authored by Andy Shevchenko and committed by Guenter Roeck bb790362 31ecad65

+8 -11
+8 -11
drivers/watchdog/intel-mid_wdt.c
··· 43 43 44 44 static int wdt_start(struct watchdog_device *wd) 45 45 { 46 + struct device *dev = watchdog_get_drvdata(wd); 46 47 int ret, in_size; 47 48 int timeout = wd->timeout; 48 49 struct ipc_wd_start { ··· 58 57 in_size = DIV_ROUND_UP(sizeof(ipc_wd_start), 4); 59 58 60 59 ret = wdt_command(SCU_WATCHDOG_START, (u32 *)&ipc_wd_start, in_size); 61 - if (ret) { 62 - struct device *dev = watchdog_get_drvdata(wd); 60 + if (ret) 63 61 dev_crit(dev, "error starting watchdog: %d\n", ret); 64 - } 65 62 66 63 return ret; 67 64 } 68 65 69 66 static int wdt_ping(struct watchdog_device *wd) 70 67 { 68 + struct device *dev = watchdog_get_drvdata(wd); 71 69 int ret; 72 70 73 71 ret = wdt_command(SCU_WATCHDOG_KEEPALIVE, NULL, 0); 74 - if (ret) { 75 - struct device *dev = watchdog_get_drvdata(wd); 76 - dev_crit(dev, "Error executing keepalive: 0x%x\n", ret); 77 - } 72 + if (ret) 73 + dev_crit(dev, "Error executing keepalive: %d\n", ret); 78 74 79 75 return ret; 80 76 } 81 77 82 78 static int wdt_stop(struct watchdog_device *wd) 83 79 { 80 + struct device *dev = watchdog_get_drvdata(wd); 84 81 int ret; 85 82 86 83 ret = wdt_command(SCU_WATCHDOG_STOP, NULL, 0); 87 - if (ret) { 88 - struct device *dev = watchdog_get_drvdata(wd); 89 - dev_crit(dev, "Error stopping watchdog: 0x%x\n", ret); 90 - } 84 + if (ret) 85 + dev_crit(dev, "Error stopping watchdog: %d\n", ret); 91 86 92 87 return ret; 93 88 }