From 6a3914c8adef8afdccde2e757e9fdf391969dfd8 Mon Sep 17 00:00:00 2001 From: David Collins Date: Thu, 14 Apr 2016 12:04:31 -0700 Subject: regulator: cpr3-regulator: unregister CPR IRQ affinity notifier correctly Commit b7d5b597f16a ("regulator: cpr3-regulator: add support for configuring CPR IRQ affinity") added a call to register_hotcpu_notifier() but did not add a call to unregister_hotcpu_notifier(). Correct this so that the IRQ affinity notifier is unregistered when a cpr3-regulator device is unregistered. Change-Id: I6379559e201f14a0fd46c1e06761fae356ec9813 CRs-Fixed: 949650 Signed-off-by: David Collins --- drivers/regulator/cpr3-regulator.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/regulator/cpr3-regulator.c b/drivers/regulator/cpr3-regulator.c index c93b71c4bc37..931227b476ac 100644 --- a/drivers/regulator/cpr3-regulator.c +++ b/drivers/regulator/cpr3-regulator.c @@ -6040,6 +6040,9 @@ int cpr3_regulator_unregister(struct cpr3_controller *ctrl) cpr3_regulator_debugfs_ctrl_remove(ctrl); mutex_unlock(&cpr3_controller_list_mutex); + if (ctrl->irq && !cpumask_empty(&ctrl->irq_affinity_mask)) + unregister_hotcpu_notifier(&ctrl->cpu_hotplug_notifier); + if (ctrl->ctrl_type == CPR_CTRL_TYPE_CPR4) rc = cpr3_ctrl_clear_cpr4_config(ctrl); if (rc) -- cgit v1.2.3