From 0b2b44e095f5d863e79dfe77e116c06ff1a1a59e Mon Sep 17 00:00:00 2001 From: haojl2 Date: Tue, 9 Oct 2018 15:37:06 +0800 Subject: [PATCH] himax_mmi: fix rmmod cause crash issue 1. Disable and free irq when rmmod. 2. Remove proc dir after all entries removed. Change-Id: Ie06eac3537ca703acbb52393d4d9ce63ae1bd9d3 Signed-off-by: haojl2 Reviewed-on: https://gerrit.mot.com/1252558 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wei Deng Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- drivers/input/touchscreen/himax_mmi/himax_common.c | 5 ++++- drivers/input/touchscreen/himax_mmi/himax_debug.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/himax_mmi/himax_common.c b/drivers/input/touchscreen/himax_mmi/himax_common.c index da8c28066820..96bc61a85e3e 100644 --- a/drivers/input/touchscreen/himax_mmi/himax_common.c +++ b/drivers/input/touchscreen/himax_mmi/himax_common.c @@ -2779,12 +2779,15 @@ void himax_chip_common_deinit(void) himax_debug_remove(); #endif - remove_proc_entry(HIMAX_PROC_TOUCH_FOLDER, NULL); himax_common_proc_deinit(); + remove_proc_entry(HIMAX_PROC_TOUCH_FOLDER, NULL); if (!ts->use_irq) { hrtimer_cancel(&ts->timer); destroy_workqueue(ts->himax_wq); + } else { + himax_int_enable(0); + free_irq(private_ts->client->irq, ts); } himax_sysfs_touchscreen(ts, false); diff --git a/drivers/input/touchscreen/himax_mmi/himax_debug.c b/drivers/input/touchscreen/himax_mmi/himax_debug.c index d86bf34f4b7a..c7cd300b6841 100644 --- a/drivers/input/touchscreen/himax_mmi/himax_debug.c +++ b/drivers/input/touchscreen/himax_mmi/himax_debug.c @@ -2612,6 +2612,7 @@ void himax_touch_proc_deinit(void) remove_proc_entry(HIMAX_PROC_DD_DEBUG_FILE, himax_touch_proc_dir); remove_proc_entry(HIMAX_PROC_REGISTER_FILE, himax_touch_proc_dir); remove_proc_entry(HIMAX_PROC_DIAG_FILE, himax_touch_proc_dir); + remove_proc_entry(HIMAX_PROC_DIAG_ARR_FILE, himax_touch_proc_dir); remove_proc_entry(HIMAX_PROC_RESET_FILE, himax_touch_proc_dir); remove_proc_entry(HIMAX_PROC_LAYOUT_FILE, himax_touch_proc_dir); remove_proc_entry(HIMAX_PROC_INT_EN_FILE, himax_touch_proc_dir);