@@ -435,7 +435,7 @@ static int chk_ucode_version(unsigned int cpu)
435
435
436
436
static struct platform_device * coretemp_get_pdev (unsigned int cpu )
437
437
{
438
- int pkgid = topology_logical_package_id (cpu );
438
+ int pkgid = topology_logical_die_id (cpu );
439
439
440
440
if (pkgid >= 0 && pkgid < max_packages )
441
441
return pkg_devices [pkgid ];
@@ -579,7 +579,7 @@ static struct platform_driver coretemp_driver = {
579
579
580
580
static struct platform_device * coretemp_device_add (unsigned int cpu )
581
581
{
582
- int err , pkgid = topology_logical_package_id (cpu );
582
+ int err , pkgid = topology_logical_die_id (cpu );
583
583
struct platform_device * pdev ;
584
584
585
585
if (pkgid < 0 )
@@ -703,7 +703,7 @@ static int coretemp_cpu_offline(unsigned int cpu)
703
703
* the rest.
704
704
*/
705
705
if (cpumask_empty (& pd -> cpumask )) {
706
- pkg_devices [topology_logical_package_id (cpu )] = NULL ;
706
+ pkg_devices [topology_logical_die_id (cpu )] = NULL ;
707
707
platform_device_unregister (pdev );
708
708
return 0 ;
709
709
}
@@ -741,7 +741,7 @@ static int __init coretemp_init(void)
741
741
if (!x86_match_cpu (coretemp_ids ))
742
742
return - ENODEV ;
743
743
744
- max_packages = topology_max_packages ();
744
+ max_packages = topology_max_packages () * topology_max_die_per_package () ;
745
745
pkg_devices = kcalloc (max_packages , sizeof (struct platform_device * ),
746
746
GFP_KERNEL );
747
747
if (!pkg_devices )
0 commit comments