[WATCHDOG] cpwd.c: Coding style - Clean-up
This brings the cpwd.c watchdog driver in line with the kernel's coding style. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
This commit is contained in:
parent
d8100c3abf
commit
927d696113
@ -94,9 +94,9 @@ static struct cpwd *cpwd_device;
|
||||
/* Sun uses Altera PLD EPF8820ATC144-4
|
||||
* providing three hardware watchdogs:
|
||||
*
|
||||
* 1) RIC - sends an interrupt when triggered
|
||||
* 2) XIR - asserts XIR_B_RESET when triggered, resets CPU
|
||||
* 3) POR - asserts POR_B_RESET when triggered, resets CPU, backplane, board
|
||||
* 1) RIC - sends an interrupt when triggered
|
||||
* 2) XIR - asserts XIR_B_RESET when triggered, resets CPU
|
||||
* 3) POR - asserts POR_B_RESET when triggered, resets CPU, backplane, board
|
||||
*
|
||||
*** Timer register block definition (struct wd_timer_regblk)
|
||||
*
|
||||
@ -108,7 +108,8 @@ static struct cpwd *cpwd_device;
|
||||
* -------------------
|
||||
* dcntr - Current 16-bit downcounter value.
|
||||
* When downcounter reaches '0' watchdog expires.
|
||||
* Reading this register resets downcounter with 'limit' value.
|
||||
* Reading this register resets downcounter with
|
||||
* 'limit' value.
|
||||
* limit - 16-bit countdown value in 1/10th second increments.
|
||||
* Writing this register begins countdown with input value.
|
||||
* Reading from this register does not affect counter.
|
||||
@ -158,11 +159,11 @@ static int wd0_timeout = 0;
|
||||
static int wd1_timeout = 0;
|
||||
static int wd2_timeout = 0;
|
||||
|
||||
module_param (wd0_timeout, int, 0);
|
||||
module_param(wd0_timeout, int, 0);
|
||||
MODULE_PARM_DESC(wd0_timeout, "Default watchdog0 timeout in 1/10secs");
|
||||
module_param (wd1_timeout, int, 0);
|
||||
module_param(wd1_timeout, int, 0);
|
||||
MODULE_PARM_DESC(wd1_timeout, "Default watchdog1 timeout in 1/10secs");
|
||||
module_param (wd2_timeout, int, 0);
|
||||
module_param(wd2_timeout, int, 0);
|
||||
MODULE_PARM_DESC(wd2_timeout, "Default watchdog2 timeout in 1/10secs");
|
||||
|
||||
MODULE_AUTHOR("Eric Brower <ebrower@usa.net>");
|
||||
@ -309,7 +310,7 @@ static int cpwd_getstatus(struct cpwd *p, int index)
|
||||
/* determine EXPIRED vs FREERUN vs RUNNING */
|
||||
else if (WD_S_EXPIRED & stat) {
|
||||
ret = WD_EXPIRED;
|
||||
} else if(WD_S_RUNNING & stat) {
|
||||
} else if (WD_S_RUNNING & stat) {
|
||||
if (intr & p->devs[index].intr_mask) {
|
||||
ret = WD_FREERUN;
|
||||
} else {
|
||||
@ -329,7 +330,8 @@ static int cpwd_getstatus(struct cpwd *p, int index)
|
||||
if (p->devs[index].runstatus & WD_STAT_SVCD) {
|
||||
ret = WD_EXPIRED;
|
||||
} else {
|
||||
/* we could as well pretend we are expired */
|
||||
/* we could as well pretend
|
||||
* we are expired */
|
||||
ret = WD_FREERUN;
|
||||
}
|
||||
} else {
|
||||
@ -342,7 +344,7 @@ static int cpwd_getstatus(struct cpwd *p, int index)
|
||||
if (p->devs[index].runstatus & WD_STAT_SVCD)
|
||||
ret |= WD_SERVICED;
|
||||
|
||||
return(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static irqreturn_t cpwd_interrupt(int irq, void *dev_id)
|
||||
@ -367,15 +369,15 @@ static int cpwd_open(struct inode *inode, struct file *f)
|
||||
struct cpwd *p = cpwd_device;
|
||||
|
||||
lock_kernel();
|
||||
switch(iminor(inode)) {
|
||||
case WD0_MINOR:
|
||||
case WD1_MINOR:
|
||||
case WD2_MINOR:
|
||||
break;
|
||||
switch (iminor(inode)) {
|
||||
case WD0_MINOR:
|
||||
case WD1_MINOR:
|
||||
case WD2_MINOR:
|
||||
break;
|
||||
|
||||
default:
|
||||
unlock_kernel();
|
||||
return -ENODEV;
|
||||
default:
|
||||
unlock_kernel();
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Register IRQ on first open of device */
|
||||
@ -458,7 +460,7 @@ static long cpwd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
|
||||
case WIOCSTOP:
|
||||
if (p->enabled)
|
||||
return(-EINVAL);
|
||||
return -EINVAL;
|
||||
|
||||
cpwd_stoptimer(p, index);
|
||||
break;
|
||||
@ -508,7 +510,7 @@ static ssize_t cpwd_write(struct file *file, const char __user *buf,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t cpwd_read(struct file * file, char __user *buffer,
|
||||
static ssize_t cpwd_read(struct file *file, char __user *buffer,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
return -EINVAL;
|
||||
|
Loading…
Reference in New Issue
Block a user