diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-13 10:00:22 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-13 10:00:22 -0500 |
commit | 4de3a8e101150feaefa1139611a50ff37467f33e (patch) | |
tree | daada742542518b02d7db7c5d32e715eaa5f166d /arch/x86/kernel/cpu/intel_cacheinfo.c | |
parent | 294064f58953f9964e5945424b09c51800330a83 (diff) | |
parent | 099469502f62fbe0d7e4f0b83a2f22538367f734 (diff) |
Merge branch 'master' into fixes
Diffstat (limited to 'arch/x86/kernel/cpu/intel_cacheinfo.c')
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index a3b0811693c9..6b45e5e7a901 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -844,8 +844,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) | |||
844 | 844 | ||
845 | #include <linux/kobject.h> | 845 | #include <linux/kobject.h> |
846 | #include <linux/sysfs.h> | 846 | #include <linux/sysfs.h> |
847 | 847 | #include <linux/cpu.h> | |
848 | extern struct sysdev_class cpu_sysdev_class; /* from drivers/base/cpu.c */ | ||
849 | 848 | ||
850 | /* pointer to kobject for cpuX/cache */ | 849 | /* pointer to kobject for cpuX/cache */ |
851 | static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject); | 850 | static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject); |
@@ -1073,9 +1072,9 @@ err_out: | |||
1073 | static DECLARE_BITMAP(cache_dev_map, NR_CPUS); | 1072 | static DECLARE_BITMAP(cache_dev_map, NR_CPUS); |
1074 | 1073 | ||
1075 | /* Add/Remove cache interface for CPU device */ | 1074 | /* Add/Remove cache interface for CPU device */ |
1076 | static int __cpuinit cache_add_dev(struct sys_device * sys_dev) | 1075 | static int __cpuinit cache_add_dev(struct device *dev) |
1077 | { | 1076 | { |
1078 | unsigned int cpu = sys_dev->id; | 1077 | unsigned int cpu = dev->id; |
1079 | unsigned long i, j; | 1078 | unsigned long i, j; |
1080 | struct _index_kobject *this_object; | 1079 | struct _index_kobject *this_object; |
1081 | struct _cpuid4_info *this_leaf; | 1080 | struct _cpuid4_info *this_leaf; |
@@ -1087,7 +1086,7 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev) | |||
1087 | 1086 | ||
1088 | retval = kobject_init_and_add(per_cpu(ici_cache_kobject, cpu), | 1087 | retval = kobject_init_and_add(per_cpu(ici_cache_kobject, cpu), |
1089 | &ktype_percpu_entry, | 1088 | &ktype_percpu_entry, |
1090 | &sys_dev->kobj, "%s", "cache"); | 1089 | &dev->kobj, "%s", "cache"); |
1091 | if (retval < 0) { | 1090 | if (retval < 0) { |
1092 | cpuid4_cache_sysfs_exit(cpu); | 1091 | cpuid4_cache_sysfs_exit(cpu); |
1093 | return retval; | 1092 | return retval; |
@@ -1124,9 +1123,9 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev) | |||
1124 | return 0; | 1123 | return 0; |
1125 | } | 1124 | } |
1126 | 1125 | ||
1127 | static void __cpuinit cache_remove_dev(struct sys_device * sys_dev) | 1126 | static void __cpuinit cache_remove_dev(struct device *dev) |
1128 | { | 1127 | { |
1129 | unsigned int cpu = sys_dev->id; | 1128 | unsigned int cpu = dev->id; |
1130 | unsigned long i; | 1129 | unsigned long i; |
1131 | 1130 | ||
1132 | if (per_cpu(ici_cpuid4_info, cpu) == NULL) | 1131 | if (per_cpu(ici_cpuid4_info, cpu) == NULL) |
@@ -1145,17 +1144,17 @@ static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb, | |||
1145 | unsigned long action, void *hcpu) | 1144 | unsigned long action, void *hcpu) |
1146 | { | 1145 | { |
1147 | unsigned int cpu = (unsigned long)hcpu; | 1146 | unsigned int cpu = (unsigned long)hcpu; |
1148 | struct sys_device *sys_dev; | 1147 | struct device *dev; |
1149 | 1148 | ||
1150 | sys_dev = get_cpu_sysdev(cpu); | 1149 | dev = get_cpu_device(cpu); |
1151 | switch (action) { | 1150 | switch (action) { |
1152 | case CPU_ONLINE: | 1151 | case CPU_ONLINE: |
1153 | case CPU_ONLINE_FROZEN: | 1152 | case CPU_ONLINE_FROZEN: |
1154 | cache_add_dev(sys_dev); | 1153 | cache_add_dev(dev); |
1155 | break; | 1154 | break; |
1156 | case CPU_DEAD: | 1155 | case CPU_DEAD: |
1157 | case CPU_DEAD_FROZEN: | 1156 | case CPU_DEAD_FROZEN: |
1158 | cache_remove_dev(sys_dev); | 1157 | cache_remove_dev(dev); |
1159 | break; | 1158 | break; |
1160 | } | 1159 | } |
1161 | return NOTIFY_OK; | 1160 | return NOTIFY_OK; |
@@ -1174,9 +1173,9 @@ static int __cpuinit cache_sysfs_init(void) | |||
1174 | 1173 | ||
1175 | for_each_online_cpu(i) { | 1174 | for_each_online_cpu(i) { |
1176 | int err; | 1175 | int err; |
1177 | struct sys_device *sys_dev = get_cpu_sysdev(i); | 1176 | struct device *dev = get_cpu_device(i); |
1178 | 1177 | ||
1179 | err = cache_add_dev(sys_dev); | 1178 | err = cache_add_dev(dev); |
1180 | if (err) | 1179 | if (err) |
1181 | return err; | 1180 | return err; |
1182 | } | 1181 | } |