From 9e58a18567ec1ef306ea7b973749e5cd9902702c Mon Sep 17 00:00:00 2001 From: Nelson Castillo Date: Tue, 10 Mar 2009 12:04:16 +0000 Subject: Use non-void configurations This patch defines a ts_filter_configuration structure to avoid using void* in the filter initialization, fixing another upstream correction. This also makes the initialization more readable. Tested in GTA02/rev6. Other changes: ~ Comment filter configuration structures. ~ ts_filter.c:ts_filter_chain_create improved. ~ Small cleanups. ~ More TODOs/FIXMEs. ~ Updated GTA02 filter configuration. ~ Updated GTA01 filter configuration. ~ Updated mach-s3c2410/include/mach/ts.h for the new ts. configuration structure. ~ Updated all the filters to use the new configuration structure. ~ Removed MAX_TS_FILTER_CHAIN constant that is no longer needed. No more evil casts left it seems. Signed-off-by: Nelson Castillo --- drivers/input/touchscreen/ts_filter_median.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'drivers/input/touchscreen/ts_filter_median.c') diff --git a/drivers/input/touchscreen/ts_filter_median.c b/drivers/input/touchscreen/ts_filter_median.c index 6187abbb803..547ca8d818a 100644 --- a/drivers/input/touchscreen/ts_filter_median.c +++ b/drivers/input/touchscreen/ts_filter_median.c @@ -103,8 +103,10 @@ static void ts_filter_median_clear(struct ts_filter *tsf) memset(&tsfm->last_issued[0], 1, tsf->count_coords * sizeof(int)); } -static struct ts_filter *ts_filter_median_create(struct platform_device *pdev, - void *conf, int count_coords) +static struct ts_filter *ts_filter_median_create( + struct platform_device *pdev, + struct ts_filter_configuration *conf, + int count_coords) { int *p; int n; @@ -114,7 +116,10 @@ static struct ts_filter *ts_filter_median_create(struct platform_device *pdev, if (!tsfm) return NULL; - tsfm->config = (struct ts_filter_median_configuration *)conf; + tsfm->config = container_of(conf, + struct ts_filter_median_configuration, + config); + tsfm->tsf.count_coords = count_coords; tsfm->config->midpoint = (tsfm->config->extent >> 1) + 1; -- cgit v1.2.3