]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Input: ucb1400_ts - fix a misleading function name
authorHans J. Koch <hjk@linutronix.de>
Mon, 13 Jul 2009 03:51:25 +0000 (20:51 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 13 Jul 2009 05:19:26 +0000 (22:19 -0700)
The driver for UCB1400 touchscreen controllers contains a function named
ucb1400_ts_pen_down(), but it returns 0 if the pen is down and 1 if it's up.
This causes confusion, especially since it's used as a boolean truth value
later in the code. This patch renames it.

Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/ucb1400_ts.c

index 6954f55001080d29b337a37c9398b6c8f867ec1a..e85483578bd4f2207e82c257430fc63a2d6d02d1 100644 (file)
@@ -128,9 +128,10 @@ static inline unsigned int ucb1400_ts_read_yres(struct ucb1400_ts *ucb)
        return ucb1400_adc_read(ucb->ac97, 0, adcsync);
 }
 
-static inline int ucb1400_ts_pen_down(struct snd_ac97 *ac97)
+static inline int ucb1400_ts_pen_up(struct snd_ac97 *ac97)
 {
        unsigned short val = ucb1400_reg_read(ac97, UCB_TS_CR);
+
        return val & (UCB_TS_CR_TSPX_LOW | UCB_TS_CR_TSMX_LOW);
 }
 
@@ -209,7 +210,7 @@ static int ucb1400_ts_thread(void *_ucb)
 
                msleep(10);
 
-               if (ucb1400_ts_pen_down(ucb->ac97)) {
+               if (ucb1400_ts_pen_up(ucb->ac97)) {
                        ucb1400_ts_irq_enable(ucb->ac97);
 
                        /*