aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/cpu.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2014-02-08 07:34:10 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-18 15:45:38 -0500
commit2b9c1f03278ab7cd421f14ce24dee39091ecb064 (patch)
treea27c0b56578e8063a164cdf184eead5b9bb35aa1 /drivers/base/cpu.c
parent67bad2fdb754dbef14596c0b5d28b3a12c8dfe84 (diff)
x86: align x86 arch with generic CPU modalias handling
The x86 CPU feature modalias handling existed before it was reimplemented generically. This patch aligns the x86 handling so that it (a) reuses some more code that is now generic; (b) uses the generic format for the modalias module metadata entry, i.e., it now uses 'cpu:type:x86,venVVVVfamFFFFmodMMMM:feature:,XXXX,YYYY' instead of the 'x86cpu:vendor:VVVV:family:FFFF:model:MMMM:feature:,XXXX,YYYY' that was used before. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: H. Peter Anvin <hpa@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/cpu.c')
-rw-r--r--drivers/base/cpu.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 8a38bf8c792f..006b1bc5297d 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -287,7 +287,6 @@ static void cpu_device_release(struct device *dev)
287 */ 287 */
288} 288}
289 289
290#ifdef CONFIG_HAVE_CPU_AUTOPROBE
291#ifdef CONFIG_GENERIC_CPU_AUTOPROBE 290#ifdef CONFIG_GENERIC_CPU_AUTOPROBE
292static ssize_t print_cpu_modalias(struct device *dev, 291static ssize_t print_cpu_modalias(struct device *dev,
293 struct device_attribute *attr, 292 struct device_attribute *attr,
@@ -310,9 +309,6 @@ static ssize_t print_cpu_modalias(struct device *dev,
310 buf[n++] = '\n'; 309 buf[n++] = '\n';
311 return n; 310 return n;
312} 311}
313#else
314#define print_cpu_modalias arch_print_cpu_modalias
315#endif
316 312
317static int cpu_uevent(struct device *dev, struct kobj_uevent_env *env) 313static int cpu_uevent(struct device *dev, struct kobj_uevent_env *env)
318{ 314{
@@ -346,7 +342,7 @@ int register_cpu(struct cpu *cpu, int num)
346 cpu->dev.offline_disabled = !cpu->hotpluggable; 342 cpu->dev.offline_disabled = !cpu->hotpluggable;
347 cpu->dev.offline = !cpu_online(num); 343 cpu->dev.offline = !cpu_online(num);
348 cpu->dev.of_node = of_get_cpu_node(num, NULL); 344 cpu->dev.of_node = of_get_cpu_node(num, NULL);
349#ifdef CONFIG_HAVE_CPU_AUTOPROBE 345#ifdef CONFIG_GENERIC_CPU_AUTOPROBE
350 cpu->dev.bus->uevent = cpu_uevent; 346 cpu->dev.bus->uevent = cpu_uevent;
351#endif 347#endif
352 cpu->dev.groups = common_cpu_attr_groups; 348 cpu->dev.groups = common_cpu_attr_groups;
@@ -370,7 +366,7 @@ struct device *get_cpu_device(unsigned cpu)
370} 366}
371EXPORT_SYMBOL_GPL(get_cpu_device); 367EXPORT_SYMBOL_GPL(get_cpu_device);
372 368
373#ifdef CONFIG_HAVE_CPU_AUTOPROBE 369#ifdef CONFIG_GENERIC_CPU_AUTOPROBE
374static DEVICE_ATTR(modalias, 0444, print_cpu_modalias, NULL); 370static DEVICE_ATTR(modalias, 0444, print_cpu_modalias, NULL);
375#endif 371#endif
376 372
@@ -384,7 +380,7 @@ static struct attribute *cpu_root_attrs[] = {
384 &cpu_attrs[2].attr.attr, 380 &cpu_attrs[2].attr.attr,
385 &dev_attr_kernel_max.attr, 381 &dev_attr_kernel_max.attr,
386 &dev_attr_offline.attr, 382 &dev_attr_offline.attr,
387#ifdef CONFIG_HAVE_CPU_AUTOPROBE 383#ifdef CONFIG_GENERIC_CPU_AUTOPROBE
388 &dev_attr_modalias.attr, 384 &dev_attr_modalias.attr,
389#endif 385#endif
390 NULL 386 NULL