Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11775
b: refs/heads/master
c: ad74557
h: refs/heads/master
i:
  11773: 908a02a
  11771: d456ae8
  11767: 57fff13
  11759: d77fb2d
  11743: 4a922cf
  11711: f9d255f
  11647: c8c2704
  11519: c5cb1be
  11263: 64a15b2
v: v3
  • Loading branch information
Ashok Raj authored and Linus Torvalds committed Oct 31, 2005
1 parent 8f0640c commit 5a178a5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5d35704028d09a183448daceab5dcb94f21a3645
refs/heads/master: ad74557a49d1dea428fb0ad60e75a5aa37610e1d
16 changes: 14 additions & 2 deletions trunk/drivers/base/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ struct sysdev_class cpu_sysdev_class = {
};
EXPORT_SYMBOL(cpu_sysdev_class);

static struct sys_device *cpu_sys_devices[NR_CPUS];

#ifdef CONFIG_HOTPLUG_CPU
int __attribute__((weak)) smp_prepare_cpu (int cpu)
{
Expand Down Expand Up @@ -64,14 +66,15 @@ static void __devinit register_cpu_control(struct cpu *cpu)
}
void unregister_cpu(struct cpu *cpu, struct node *root)
{
int logical_cpu = cpu->sysdev.id;

if (root)
sysfs_remove_link(&root->sysdev.kobj,
kobject_name(&cpu->sysdev.kobj));
sysdev_remove_file(&cpu->sysdev, &attr_online);

sysdev_unregister(&cpu->sysdev);

cpu_sys_devices[logical_cpu] = NULL;
return;
}
#else /* ... !CONFIG_HOTPLUG_CPU */
Expand Down Expand Up @@ -103,10 +106,19 @@ int __devinit register_cpu(struct cpu *cpu, int num, struct node *root)
kobject_name(&cpu->sysdev.kobj));
if (!error && !cpu->no_control)
register_cpu_control(cpu);
if (!error)
cpu_sys_devices[num] = &cpu->sysdev;
return error;
}


struct sys_device *get_cpu_sysdev(int cpu)
{
if (cpu < NR_CPUS)
return cpu_sys_devices[cpu];
else
return NULL;
}
EXPORT_SYMBOL_GPL(get_cpu_sysdev);

int __init cpu_dev_init(void)
{
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ struct cpu {
};

extern int register_cpu(struct cpu *, int, struct node *);
extern struct sys_device *get_cpu_sysdev(int cpu);
#ifdef CONFIG_HOTPLUG_CPU
extern void unregister_cpu(struct cpu *, struct node *);
#endif
Expand Down

0 comments on commit 5a178a5

Please sign in to comment.