Merge "input: touchscreen: synaptics_dsx: Handle failure case during probe"

This commit is contained in:
Linux Build Service Account 2018-03-15 05:42:47 -07:00 committed by Gerrit - the friendly Code Review server
commit a9a39fb11e

View file

@ -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);