* [PATCH] trivial: ucb1400_ts: Fix a misleading function name
@ 2009-07-09 14:46 Hans J. Koch
2009-07-13 3:47 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Hans J. Koch @ 2009-07-09 14:46 UTC (permalink / raw)
To: linux-kernel; +Cc: dmitry.torokhov, nico
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>
---
drivers/input/touchscreen/ucb1400_ts.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6.31-rc/drivers/input/touchscreen/ucb1400_ts.c
===================================================================
--- linux-2.6.31-rc.orig/drivers/input/touchscreen/ucb1400_ts.c 2009-07-09 14:45:45.000000000 +0200
+++ linux-2.6.31-rc/drivers/input/touchscreen/ucb1400_ts.c 2009-07-09 14:46:57.000000000 +0200
@@ -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);
/*
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] trivial: ucb1400_ts: Fix a misleading function name
2009-07-09 14:46 [PATCH] trivial: ucb1400_ts: Fix a misleading function name Hans J. Koch
@ 2009-07-13 3:47 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2009-07-13 3:47 UTC (permalink / raw)
To: Hans J. Koch; +Cc: linux-kernel, nico
On Thu, Jul 09, 2009 at 04:46:21PM +0200, Hans J. Koch wrote:
> 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>
>
Applied to 'next;' branch, thank you Hans.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-13 3:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-09 14:46 [PATCH] trivial: ucb1400_ts: Fix a misleading function name Hans J. Koch
2009-07-13 3:47 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox