Skip to content

Commit

Permalink
parisc: check return value of down_interruptible() in hp_sdc_rtc.c
Browse files Browse the repository at this point in the history
additionally comment out unused code (which may be used later)

Signed-off-by: Helge Deller <deller@gmx.de>
  • Loading branch information
hdeller committed Mar 2, 2013
1 parent d8d0524 commit 15fb968
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions drivers/input/misc/hp_sdc_rtc.c
Expand Up @@ -109,7 +109,9 @@ static int hp_sdc_rtc_do_read_bbrtc (struct rtc_time *rtctm)

if (hp_sdc_enqueue_transaction(&t)) return -1;

down_interruptible(&tsem); /* Put ourselves to sleep for results. */
/* Put ourselves to sleep for results. */
if (WARN_ON(down_interruptible(&tsem)))
return -1;

/* Check for nonpresence of BBRTC */
if (!((tseq[83] | tseq[90] | tseq[69] | tseq[76] |
Expand Down Expand Up @@ -176,11 +178,16 @@ static int64_t hp_sdc_rtc_read_i8042timer (uint8_t loadcmd, int numreg)
t.seq = tseq;
t.act.semaphore = &i8042tregs;

down_interruptible(&i8042tregs); /* Sleep if output regs in use. */
/* Sleep if output regs in use. */
if (WARN_ON(down_interruptible(&i8042tregs)))
return -1;

if (hp_sdc_enqueue_transaction(&t)) return -1;

down_interruptible(&i8042tregs); /* Sleep until results come back. */
/* Sleep until results come back. */
if (WARN_ON(down_interruptible(&i8042tregs)))
return -1;

up(&i8042tregs);

return (tseq[5] |
Expand Down Expand Up @@ -276,6 +283,7 @@ static inline int hp_sdc_rtc_read_ct(struct timeval *res) {
}


#if 0 /* not used yet */
/* Set the i8042 real-time clock */
static int hp_sdc_rtc_set_rt (struct timeval *setto)
{
Expand Down Expand Up @@ -386,6 +394,7 @@ static int hp_sdc_rtc_set_i8042timer (struct timeval *setto, uint8_t setcmd)
}
return 0;
}
#endif

static ssize_t hp_sdc_rtc_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos) {
Expand Down

0 comments on commit 15fb968

Please sign in to comment.