@@ -109,10 +109,10 @@ struct platform_data {
109
109
struct device_attribute name_attr ;
110
110
};
111
111
112
- /* Keep track of how many package pointers we allocated in init() */
113
- static int max_packages __read_mostly ;
114
- /* Array of package pointers. Serialized by cpu hotplug lock */
115
- static struct platform_device * * pkg_devices ;
112
+ /* Keep track of how many zone pointers we allocated in init() */
113
+ static int max_zones __read_mostly ;
114
+ /* Array of zone pointers. Serialized by cpu hotplug lock */
115
+ static struct platform_device * * zone_devices ;
116
116
117
117
static ssize_t show_label (struct device * dev ,
118
118
struct device_attribute * devattr , char * buf )
@@ -435,10 +435,10 @@ 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_die_id (cpu );
438
+ int id = topology_logical_die_id (cpu );
439
439
440
- if (pkgid >= 0 && pkgid < max_packages )
441
- return pkg_devices [ pkgid ];
440
+ if (id >= 0 && id < max_zones )
441
+ return zone_devices [ id ];
442
442
return NULL ;
443
443
}
444
444
@@ -544,7 +544,7 @@ static int coretemp_probe(struct platform_device *pdev)
544
544
struct device * dev = & pdev -> dev ;
545
545
struct platform_data * pdata ;
546
546
547
- /* Initialize the per-package data structures */
547
+ /* Initialize the per-zone data structures */
548
548
pdata = devm_kzalloc (dev , sizeof (struct platform_data ), GFP_KERNEL );
549
549
if (!pdata )
550
550
return - ENOMEM ;
@@ -579,13 +579,13 @@ 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_die_id (cpu );
582
+ int err , zoneid = topology_logical_die_id (cpu );
583
583
struct platform_device * pdev ;
584
584
585
- if (pkgid < 0 )
585
+ if (zoneid < 0 )
586
586
return ERR_PTR (- ENOMEM );
587
587
588
- pdev = platform_device_alloc (DRVNAME , pkgid );
588
+ pdev = platform_device_alloc (DRVNAME , zoneid );
589
589
if (!pdev )
590
590
return ERR_PTR (- ENOMEM );
591
591
@@ -595,7 +595,7 @@ static struct platform_device *coretemp_device_add(unsigned int cpu)
595
595
return ERR_PTR (err );
596
596
}
597
597
598
- pkg_devices [ pkgid ] = pdev ;
598
+ zone_devices [ zoneid ] = pdev ;
599
599
return pdev ;
600
600
}
601
601
@@ -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_die_id (cpu )] = NULL ;
706
+ zone_devices [topology_logical_die_id (cpu )] = NULL ;
707
707
platform_device_unregister (pdev );
708
708
return 0 ;
709
709
}
@@ -741,10 +741,10 @@ 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 () * topology_max_die_per_package ();
745
- pkg_devices = kcalloc (max_packages , sizeof (struct platform_device * ),
744
+ max_zones = topology_max_packages () * topology_max_die_per_package ();
745
+ zone_devices = kcalloc (max_zones , sizeof (struct platform_device * ),
746
746
GFP_KERNEL );
747
- if (!pkg_devices )
747
+ if (!zone_devices )
748
748
return - ENOMEM ;
749
749
750
750
err = platform_driver_register (& coretemp_driver );
@@ -760,7 +760,7 @@ static int __init coretemp_init(void)
760
760
761
761
outdrv :
762
762
platform_driver_unregister (& coretemp_driver );
763
- kfree (pkg_devices );
763
+ kfree (zone_devices );
764
764
return err ;
765
765
}
766
766
module_init (coretemp_init )
@@ -769,7 +769,7 @@ static void __exit coretemp_exit(void)
769
769
{
770
770
cpuhp_remove_state (coretemp_hp_online );
771
771
platform_driver_unregister (& coretemp_driver );
772
- kfree (pkg_devices );
772
+ kfree (zone_devices );
773
773
}
774
774
module_exit (coretemp_exit )
775
775
0 commit comments