aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/sc1200wdt.c
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2008-07-18 07:41:17 -0400
committerWim Van Sebroeck <wim@iguana.be>2008-08-06 09:21:09 -0400
commit0c06090c9472db0525cb6fe229c3bea33bbbbb3c (patch)
treeb01c21f6ef5649b6f0071dee4a55cb3ba236a7b8 /drivers/watchdog/sc1200wdt.c
parent5eb82498e3a6da8a979c48945e3c1a85c10ccc25 (diff)
[WATCHDOG] Coding style - Indentation - part 2
This brings the watchdog drivers into line with coding style. This patch takes cares of the indentation as described in chapter 1. Main changes: * Re-structure the ioctl switch call for all drivers as follows: switch (cmd) { case WDIOC_GETSUPPORT: case WDIOC_GETSTATUS: case WDIOC_GETBOOTSTATUS: case WDIOC_GETTEMP: case WDIOC_SETOPTIONS: case WDIOC_KEEPALIVE: case WDIOC_SETTIMEOUT: case WDIOC_GETTIMEOUT: case WDIOC_GETTIMELEFT: default: } This to make the migration from the drivers to the uniform watchdog device driver easier in the future. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/sc1200wdt.c')
-rw-r--r--drivers/watchdog/sc1200wdt.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/watchdog/sc1200wdt.c b/drivers/watchdog/sc1200wdt.c
index 03e67fa4d689..f3bdc8227cc4 100644
--- a/drivers/watchdog/sc1200wdt.c
+++ b/drivers/watchdog/sc1200wdt.c
@@ -207,24 +207,6 @@ static long sc1200wdt_ioctl(struct file *file, unsigned int cmd,
207 case WDIOC_GETBOOTSTATUS: 207 case WDIOC_GETBOOTSTATUS:
208 return put_user(0, p); 208 return put_user(0, p);
209 209
210 case WDIOC_KEEPALIVE:
211 sc1200wdt_write_data(WDTO, timeout);
212 return 0;
213
214 case WDIOC_SETTIMEOUT:
215 if (get_user(new_timeout, p))
216 return -EFAULT;
217 /* the API states this is given in secs */
218 new_timeout /= 60;
219 if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
220 return -EINVAL;
221 timeout = new_timeout;
222 sc1200wdt_write_data(WDTO, timeout);
223 /* fall through and return the new timeout */
224
225 case WDIOC_GETTIMEOUT:
226 return put_user(timeout * 60, p);
227
228 case WDIOC_SETOPTIONS: 210 case WDIOC_SETOPTIONS:
229 { 211 {
230 int options, retval = -EINVAL; 212 int options, retval = -EINVAL;
@@ -244,6 +226,24 @@ static long sc1200wdt_ioctl(struct file *file, unsigned int cmd,
244 226
245 return retval; 227 return retval;
246 } 228 }
229 case WDIOC_KEEPALIVE:
230 sc1200wdt_write_data(WDTO, timeout);
231 return 0;
232
233 case WDIOC_SETTIMEOUT:
234 if (get_user(new_timeout, p))
235 return -EFAULT;
236 /* the API states this is given in secs */
237 new_timeout /= 60;
238 if (new_timeout < 0 || new_timeout > MAX_TIMEOUT)
239 return -EINVAL;
240 timeout = new_timeout;
241 sc1200wdt_write_data(WDTO, timeout);
242 /* fall through and return the new timeout */
243
244 case WDIOC_GETTIMEOUT:
245 return put_user(timeout * 60, p);
246
247 default: 247 default:
248 return -ENOTTY; 248 return -ENOTTY;
249 } 249 }