-
- if (attr) {
- len = strlen(path);
- len += strlen(attr->name) + 2;
- attrpath = kmalloc(len, gfp_mask);
- if (!attrpath)
- goto exit;
- sprintf(attrpath, "%s/%s", path, attr->name);
- rc = send_uevent(signal, attrpath, NULL, gfp_mask);
- kfree(attrpath);
- } else
- rc = send_uevent(signal, path, NULL, gfp_mask);
-
-exit:
- kfree(path);
- return rc;
-}
-
-/**
- * kobject_uevent - notify userspace by sending event through netlink socket
- *
- * @signal: signal name
- * @kobj: struct kobject that the event is happening to
- * @attr: optional struct attribute the event belongs to
- */
-int kobject_uevent(struct kobject *kobj, enum kobject_action action,
- struct attribute *attr)
-{
- return do_kobject_uevent(kobj, action, attr, GFP_KERNEL);
-}
-EXPORT_SYMBOL_GPL(kobject_uevent);
-
-int kobject_uevent_atomic(struct kobject *kobj, enum kobject_action action,
- struct attribute *attr)
-{
- return do_kobject_uevent(kobj, action, attr, GFP_ATOMIC);
-}
-EXPORT_SYMBOL_GPL(kobject_uevent_atomic);
-
-static int __init kobject_uevent_init(void)
-{
- uevent_sock = netlink_kernel_create(NETLINK_KOBJECT_UEVENT, NULL);
-
- if (!uevent_sock) {
- printk(KERN_ERR
- "kobject_uevent: unable to create netlink socket!\n");
- return -ENODEV;