spmi: pmic_arb: Add qpnp-int controller unregistration call

Upon device removal, we should take care to unregister the
controller from qpnp-int so that qpnp-int doesn't make bad
assumptions that the controller is still there.

Change-Id: I06f5994d5f8c457c178edc9b68d92855f48535e3
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
This commit is contained in:
Michael Bohan 2013-02-27 18:45:14 -08:00 committed by Stephen Boyd
parent a604f3724c
commit 677161abd5
1 changed files with 7 additions and 1 deletions

View File

@ -763,12 +763,18 @@ err_add_controller:
static int spmi_pmic_arb_remove(struct platform_device *pdev)
{
struct spmi_pmic_arb_dev *pmic_arb = platform_get_drvdata(pdev);
int ret;
ret = qpnpint_unregister_controller(pmic_arb->controller.dev.of_node);
if (ret)
dev_err(&pdev->dev, "Unable to unregister controller %d\n",
pmic_arb->controller.nr);
if (pmic_arb->allow_wakeup)
irq_set_irq_wake(pmic_arb->pic_irq, 0);
platform_set_drvdata(pdev, NULL);
spmi_del_controller(&pmic_arb->controller);
return 0;
return ret;
}
static struct of_device_id spmi_pmic_arb_match_table[] = {