Skip to contentSkip to conversation

trivial: ucb1400_ts: Fix a misleading function name

PATCH Applied Hans J. Koch 2 participants 2 messages Jul 9, 2009 – Jul 13, 2009 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trivial: ucb1400_ts: Fix a misleading function name

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.

---
 drivers/input/touchscreen/ucb1400_ts.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/touchscreen/ucb1400_ts.c +2 -2
Index: linux-2.6.31-rc/drivers/input/touchscreen/ucb1400_ts.c
===================================================================
@@ -128,7 +128,7 @@
 	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 +209,7 @@
 
 		msleep(10);
 
-		if (ucb1400_ts_pen_down(ucb->ac97)) {
+		if (ucb1400_ts_pen_up(ucb->ac97)) {
 			ucb1400_ts_irq_enable(ucb->ac97);
 
 			/*
maintainer Applied
#1 lore raw
Quoted 7 lines · Hans J. Koch

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.

Applied to 'next;' branch, thank you Hans.

Signature · 1 line
Dmitry