diff options
author | Nelson Castillo <arhuaco@freaks-unidos.net> | 2009-01-06 15:26:34 +0000 |
---|---|---|
committer | Andy Green <agreen@pads.home.warmcat.com> | 2009-01-06 15:26:34 +0000 |
commit | 03a07f0da5734683a92623ecf98607e22077d36b (patch) | |
tree | 7c3adeafe15cecdff95656885103f68da6190e59 /drivers/input | |
parent | 437cd31cff7d4a474a139f4b76fb7040e060fc79 (diff) |
Make group filter return samples
For consistency the group filter should return samples if it is the last
filter in the chain. It is useful when you want to check what the filter
does.
Signed-off-by: Nelson Castillo <arhuaco@freaks-unidos.net>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/ts_filter_group.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/input/touchscreen/ts_filter_group.c b/drivers/input/touchscreen/ts_filter_group.c index 80e6677d0cf..73e3625a5a6 100644 --- a/drivers/input/touchscreen/ts_filter_group.c +++ b/drivers/input/touchscreen/ts_filter_group.c @@ -182,8 +182,6 @@ static int ts_filter_group_process(struct ts_filter *tsf, int *coords) tsfg->range_max[n] = v[best_idx + best_size - 1]; } - BUG_ON(!tsf->next); - for (i = 0; i < tsfg->N; ++i) { int r; @@ -197,10 +195,14 @@ static int ts_filter_group_process(struct ts_filter *tsf, int *coords) if (n != tsfg->tsf.count_coords) /* sample not OK */ continue; - r = (tsf->next->api->process)(tsf->next, coords); - if (r) { - ret = r; - break; + if (tsf->next) { + r = (tsf->next->api->process)(tsf->next, coords); + if (r) { + ret = r; + break; + } + } else if (i == tsfg->N - 1) { + ret = 1; } } |