[PATCH] generate hotplug events for cpu online
authorNathan Lynch <ntl@pobox.com>
Sat, 25 Jun 2005 21:55:05 +0000 (14:55 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 25 Jun 2005 23:24:31 +0000 (16:24 -0700)
We already do kobject_hotplug for cpu offline; this adds a kobject_hotplug
call for the online case.  This is being requested by developers of an
application which wants to be notified about both kinds of events.

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/base/cpu.c

index 0bf2dc11cdb8aa56c8728933ab61329120795280..b79badd0f1588dea649df9033652f0f5d2afbacf 100644 (file)
@@ -44,6 +44,8 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
                ret = smp_prepare_cpu(cpu->sysdev.id);
                if (!ret)
                        ret = cpu_up(cpu->sysdev.id);
+               if (!ret)
+                       kobject_hotplug(&dev->kobj, KOBJ_ONLINE);
                break;
        default:
                ret = -EINVAL;