X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=drivers%2Fhwmon%2Fpkgtemp.c;h=a8fc35e854c739b55bd249fa581729728f4a83e8;hb=fd53d08465a79d742a297be1d7d173f8a13972a6;hp=f11903936c8b3a51c3f8dddcb20318185952fa79;hpb=dd4025bdb6c731b6cd23f97797ef6d8dbfeb9e9d;p=cascardo%2Flinux.git diff --git a/drivers/hwmon/pkgtemp.c b/drivers/hwmon/pkgtemp.c index f11903936c8b..a8fc35e854c7 100644 --- a/drivers/hwmon/pkgtemp.c +++ b/drivers/hwmon/pkgtemp.c @@ -21,7 +21,6 @@ */ #include -#include #include #include #include @@ -35,6 +34,7 @@ #include #include #include +#include #define DRVNAME "pkgtemp" @@ -340,7 +340,7 @@ exit: } #ifdef CONFIG_HOTPLUG_CPU -static void pkgtemp_device_remove(unsigned int cpu) +static void __cpuinit pkgtemp_device_remove(unsigned int cpu) { struct pdev_entry *p; unsigned int i; @@ -392,7 +392,6 @@ static struct notifier_block pkgtemp_cpu_notifier __refdata = { static int __init pkgtemp_init(void) { int i, err = -ENODEV; - struct pdev_entry *p, *n; /* quick check if we run Intel */ if (cpu_data(0).x86_vendor != X86_VENDOR_INTEL) @@ -402,31 +401,25 @@ static int __init pkgtemp_init(void) if (err) goto exit; - for_each_online_cpu(i) { - err = pkgtemp_device_add(i); - if (err) - goto exit_devices_unreg; - } + for_each_online_cpu(i) + pkgtemp_device_add(i); + +#ifndef CONFIG_HOTPLUG_CPU if (list_empty(&pdev_list)) { err = -ENODEV; goto exit_driver_unreg; } +#endif #ifdef CONFIG_HOTPLUG_CPU register_hotcpu_notifier(&pkgtemp_cpu_notifier); #endif return 0; -exit_devices_unreg: - mutex_lock(&pdev_list_mutex); - list_for_each_entry_safe(p, n, &pdev_list, list) { - platform_device_unregister(p->pdev); - list_del(&p->list); - kfree(p); - } - mutex_unlock(&pdev_list_mutex); +#ifndef CONFIG_HOTPLUG_CPU exit_driver_unreg: platform_driver_unregister(&pkgtemp_driver); +#endif exit: return err; }