From 03a07f0da5734683a92623ecf98607e22077d36b Mon Sep 17 00:00:00 2001 From: Nelson Castillo Date: Tue, 6 Jan 2009 15:26:34 +0000 Subject: 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 --- drivers/input/touchscreen/ts_filter_group.c | 14 ++++++++------ 1 file 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; } } -- cgit v1.2.3