diff options
| author | Venkata Prahlad Valluru <vvalluru@codeaurora.org> | 2018-03-13 18:48:44 +0530 |
|---|---|---|
| committer | Venkata Prahlad Valluru <vvalluru@codeaurora.org> | 2018-03-13 18:50:05 +0530 |
| commit | 545199223e0ca8bcc97e55e3caf1dacd5ff30833 (patch) | |
| tree | f52f1b7d15da0a52f82ecb71831c809ec17fdbb6 | |
| parent | e6408fea602f42dd516ee9ec0ffde2a6df9a839d (diff) | |
input: touchscreen: synaptics_dsx: Handle failure case during probe
Handle create_singlethread_workqueue api failure case.
Change-Id: Ic3f45fddfbd40d8a78dd888eed5f01120809adee
Signed-off-by: Venkata Prahlad Valluru <vvalluru@codeaurora.org>
| -rw-r--r-- | drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c b/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c index 93c9c3c373b8..a9a835de9a1a 100644 --- a/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c +++ b/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_core.c @@ -5,7 +5,7 @@ * * Copyright (C) 2012 Alexandra Chin <alexandra.chin@tw.synaptics.com> * Copyright (C) 2012 Scott Lin <scott.lin@tw.synaptics.com> - * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -3808,6 +3808,13 @@ static int synaptics_rmi4_probe(struct platform_device *pdev) } exp_data.workqueue = create_singlethread_workqueue("dsx_exp_workqueue"); + if (exp_data.workqueue == NULL) { + dev_err(&pdev->dev, + "%s: Failed to create workqueue\n", __func__); + retval = -ENOMEM; + goto err_create_wq; + } + INIT_DELAYED_WORK(&exp_data.work, synaptics_rmi4_exp_fn_work); exp_data.rmi4_data = rmi4_data; exp_data.queue_work = true; @@ -3859,10 +3866,9 @@ err_create_debugfs_file: debugfs_remove_recursive(rmi4_data->dir); err_create_debugfs_dir: cancel_delayed_work_sync(&exp_data.work); - if (exp_data.workqueue != NULL) { - flush_workqueue(exp_data.workqueue); - destroy_workqueue(exp_data.workqueue); - } + flush_workqueue(exp_data.workqueue); + destroy_workqueue(exp_data.workqueue); +err_create_wq: synaptics_rmi4_irq_enable(rmi4_data, false); free_irq(rmi4_data->irq, rmi4_data); |
