diff options
author | Mark Kuo <mkuo@nvidia.com> | 2012-12-21 19:21:31 +0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:49:04 -0700 |
commit | 4d98bf69a361db72b2641166d16653bf3eea8265 (patch) | |
tree | 388d082ee4ed38d8fb44cd8848704682ec7c74ef /drivers/input | |
parent | b2f92e8eff8fa0490914efda2b1219cff5026444 (diff) |
input: touch: raydium: fix panic when touch panel not attached
Use rm31080_spi_checking() to check if the hardware is present,
and move the checking to the front of the driver init function
so as to avoid registering suspend/resume function which later
causes kernel panic when system suspends.
bug 1207093
Change-Id: I775e4cae70745ee5ef9ae29888a95b4b770df0db
Signed-off-by: Mark Kuo <mkuo@nvidia.com>
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/187746
(cherry picked from commit 41f0d55dcf8ea7b6dd47b6ea7c19eff319128784)
Reviewed-on: http://git-master/r/189030
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/touchscreen/rm31080a_ts.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/rm31080a_ts.c b/drivers/input/touchscreen/rm31080a_ts.c index 6830d1a9f9f5..03729dda876e 100644 --- a/drivers/input/touchscreen/rm31080a_ts.c +++ b/drivers/input/touchscreen/rm31080a_ts.c @@ -1918,6 +1918,13 @@ struct rm31080_ts *rm31080_input_init(struct device *dev, unsigned int irq, goto err_out; } + err = rm31080_spi_checking(0); + /* succeed return: 1, failed: 0 */ + if (err == 0) { + err = -ENODEV; + goto err_out; + } + ts = kzalloc(sizeof(*ts), GFP_KERNEL); input_dev = input_allocate_device(); @@ -2301,8 +2308,6 @@ static int rm31080_spi_probe(struct spi_device *spi) rm31080_init_ts_structure_part(); - if (!rm31080_spi_checking(0)) - goto err_unregister_notifier; if (misc_register(&raydium_ts_miscdev) != 0) { dev_err(&spi->dev, "Raydium TS: cannot register miscdev\n"); |