Commit 28b5fd22 authored by Andrew Morton's avatar Andrew Morton Committed by Greg Kroah-Hartman

[PATCH] remove cpu_run_sbin_hotplug()

From: Keshavamurthy Anil S <anil.s.keshavamurthy@intel.com>

Remove cpu_run_sbin_hotplug() - use kobject_hotplug() instead.
Signed-off-by: default avatarAnil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent bbf210d9
......@@ -32,6 +32,8 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
switch (buf[0]) {
case '0':
ret = cpu_down(cpu->sysdev.id);
if (!ret)
kobject_hotplug(&dev->kobj, KOBJ_OFFLINE);
break;
case '1':
ret = cpu_up(cpu->sysdev.id);
......
......@@ -22,6 +22,7 @@ enum kobject_action {
KOBJ_CHANGE = (__force kobject_action_t) 0x03, /* a sysfs attribute file has changed */
KOBJ_MOUNT = (__force kobject_action_t) 0x04, /* mount event for block devices */
KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices */
KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* offline event for hotplug devices */
};
......
......@@ -57,34 +57,6 @@ static inline void check_for_tasks(int cpu)
write_unlock_irq(&tasklist_lock);
}
/* Notify userspace when a cpu event occurs, by running '/sbin/hotplug
* cpu' with certain environment variables set. */
static int cpu_run_sbin_hotplug(unsigned int cpu, const char *action)
{
char *argv[3], *envp[6], cpu_str[12], action_str[32], devpath_str[40];
int i;
sprintf(cpu_str, "CPU=%d", cpu);
sprintf(action_str, "ACTION=%s", action);
sprintf(devpath_str, "DEVPATH=devices/system/cpu/cpu%d", cpu);
i = 0;
argv[i++] = hotplug_path;
argv[i++] = "cpu";
argv[i] = NULL;
i = 0;
/* minimal command environment */
envp[i++] = "HOME=/";
envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
envp[i++] = cpu_str;
envp[i++] = action_str;
envp[i++] = devpath_str;
envp[i] = NULL;
return call_usermodehelper(argv[0], argv, envp, 0);
}
/* Take this CPU down. */
static int take_cpu_down(void *unused)
{
......@@ -170,8 +142,6 @@ int cpu_down(unsigned int cpu)
check_for_tasks(cpu);
cpu_run_sbin_hotplug(cpu, "offline");
out_thread:
err = kthread_stop(p);
out_allowed:
......@@ -180,11 +150,6 @@ int cpu_down(unsigned int cpu)
unlock_cpu_hotplug();
return err;
}
#else
static inline int cpu_run_sbin_hotplug(unsigned int cpu, const char *action)
{
return 0;
}
#endif /*CONFIG_HOTPLUG_CPU*/
int __devinit cpu_up(unsigned int cpu)
......
......@@ -36,6 +36,8 @@ static char *action_to_string(enum kobject_action action)
return "mount";
case KOBJ_UMOUNT:
return "umount";
case KOBJ_OFFLINE:
return "offline";
default:
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment