From 98d8e006cbef2b11929a3ed3a6b8366952f58a96 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 13 Sep 2010 10:23:05 +0000 Subject: [PATCH] --- yaml --- r: 210987 b: refs/heads/master c: e40cc4bdfd4b89813f072f72bd9c7055814d3f0f h: refs/heads/master i: 210985: 4993b8757072658776642623966808b59e86c3c6 210983: 13a8696ce326fa18c9f6cb37e719e3c305d02218 v: v3 --- [refs] | 2 +- trunk/drivers/hwmon/coretemp.c | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 20c454c7641f..5841cbc13ee6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f6aeccdb96fc0555e939dd507702922f07dcbcbb +refs/heads/master: e40cc4bdfd4b89813f072f72bd9c7055814d3f0f diff --git a/trunk/drivers/hwmon/coretemp.c b/trunk/drivers/hwmon/coretemp.c index 5850da64ae28..baa842a80b4b 100644 --- a/trunk/drivers/hwmon/coretemp.c +++ b/trunk/drivers/hwmon/coretemp.c @@ -491,14 +491,22 @@ static int __cpuinit coretemp_device_add(unsigned int cpu) static void coretemp_device_remove(unsigned int cpu) { - struct pdev_entry *p, *n; + struct pdev_entry *p; + unsigned int i; + mutex_lock(&pdev_list_mutex); - list_for_each_entry_safe(p, n, &pdev_list, list) { - if (p->cpu == cpu) { - platform_device_unregister(p->pdev); - list_del(&p->list); - kfree(p); - } + list_for_each_entry(p, &pdev_list, list) { + if (p->cpu != cpu) + continue; + + platform_device_unregister(p->pdev); + list_del(&p->list); + mutex_unlock(&pdev_list_mutex); + kfree(p); + for_each_cpu(i, cpu_sibling_mask(cpu)) + if (i != cpu && !coretemp_device_add(i)) + break; + return; } mutex_unlock(&pdev_list_mutex); }