mfd: wcd9xxx: send down notification to devices before cleaning-up IRQs

IRQ clean up should be done only after codec devices have been
notified with device down. Without this, there are chances of
race-condition where some of the resources like locks used for
safe handling of the IRQs would be used after those are freed.

CRs-Fixed: 1102353
Change-Id: I276571a7e50fcf227febd86494589b14988e3d41
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
This commit is contained in:
Banajit Goswami 2016-01-06 12:13:17 -08:00 committed by Gerrit - the friendly Code Review server
parent efdbbff86b
commit 76771ab5ac

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and
@ -1508,9 +1508,9 @@ static int wcd9xxx_slim_device_down(struct slim_device *sldev)
return 0; return 0;
wcd9xxx->dev_up = false; wcd9xxx->dev_up = false;
wcd9xxx_irq_exit(&wcd9xxx->core_res);
if (wcd9xxx->dev_down) if (wcd9xxx->dev_down)
wcd9xxx->dev_down(wcd9xxx); wcd9xxx->dev_down(wcd9xxx);
wcd9xxx_irq_exit(&wcd9xxx->core_res);
wcd9xxx_reset_low(wcd9xxx->dev); wcd9xxx_reset_low(wcd9xxx->dev);
return 0; return 0;
} }