mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
[PATCH] driver core: replace "hotplug" by "uevent"
Leave the overloaded "hotplug" word to susbsystems which are handling real devices. The driver core does not "plug" anything, it just exports the state to userspace and generates events. Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
5f123fbd80
commit
312c004d36
40 changed files with 372 additions and 378 deletions
|
|
@ -172,21 +172,21 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
|
|||
if (ACPI_FAILURE(status) || !device) {
|
||||
result = container_device_add(&device, handle);
|
||||
if (!result)
|
||||
kobject_hotplug(&device->kobj,
|
||||
KOBJ_ONLINE);
|
||||
kobject_uevent(&device->kobj,
|
||||
KOBJ_ONLINE);
|
||||
else
|
||||
printk("Failed to add container\n");
|
||||
}
|
||||
} else {
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
/* device exist and this is a remove request */
|
||||
kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
|
||||
kobject_uevent(&device->kobj, KOBJ_OFFLINE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ACPI_NOTIFY_EJECT_REQUEST:
|
||||
if (!acpi_bus_get_device(handle, &device) && device) {
|
||||
kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
|
||||
kobject_uevent(&device->kobj, KOBJ_OFFLINE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -748,7 +748,7 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
|
|||
return_VALUE(-ENODEV);
|
||||
|
||||
if ((pr->id >= 0) && (pr->id < NR_CPUS)) {
|
||||
kobject_hotplug(&(*device)->kobj, KOBJ_ONLINE);
|
||||
kobject_uevent(&(*device)->kobj, KOBJ_ONLINE);
|
||||
}
|
||||
return_VALUE(0);
|
||||
}
|
||||
|
|
@ -788,13 +788,13 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
|
|||
}
|
||||
|
||||
if (pr->id >= 0 && (pr->id < NR_CPUS)) {
|
||||
kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
|
||||
kobject_uevent(&device->kobj, KOBJ_OFFLINE);
|
||||
break;
|
||||
}
|
||||
|
||||
result = acpi_processor_start(device);
|
||||
if ((!result) && ((pr->id >= 0) && (pr->id < NR_CPUS))) {
|
||||
kobject_hotplug(&device->kobj, KOBJ_ONLINE);
|
||||
kobject_uevent(&device->kobj, KOBJ_ONLINE);
|
||||
} else {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||
"Device [%s] failed to start\n",
|
||||
|
|
@ -818,7 +818,7 @@ acpi_processor_hotplug_notify(acpi_handle handle, u32 event, void *data)
|
|||
}
|
||||
|
||||
if ((pr->id < NR_CPUS) && (cpu_present(pr->id)))
|
||||
kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
|
||||
kobject_uevent(&device->kobj, KOBJ_OFFLINE);
|
||||
break;
|
||||
default:
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ static struct kobj_type ktype_acpi_ns = {
|
|||
.release = acpi_device_release,
|
||||
};
|
||||
|
||||
static int namespace_hotplug(struct kset *kset, struct kobject *kobj,
|
||||
static int namespace_uevent(struct kset *kset, struct kobject *kobj,
|
||||
char **envp, int num_envp, char *buffer,
|
||||
int buffer_size)
|
||||
{
|
||||
|
|
@ -89,8 +89,8 @@ static int namespace_hotplug(struct kset *kset, struct kobject *kobj,
|
|||
if (!dev->driver)
|
||||
return 0;
|
||||
|
||||
if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &len,
|
||||
"PHYSDEVDRIVER=%s", dev->driver->name))
|
||||
if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
|
||||
"PHYSDEVDRIVER=%s", dev->driver->name))
|
||||
return -ENOMEM;
|
||||
|
||||
envp[i] = NULL;
|
||||
|
|
@ -98,8 +98,8 @@ static int namespace_hotplug(struct kset *kset, struct kobject *kobj,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct kset_hotplug_ops namespace_hotplug_ops = {
|
||||
.hotplug = &namespace_hotplug,
|
||||
static struct kset_uevent_ops namespace_uevent_ops = {
|
||||
.uevent = &namespace_uevent,
|
||||
};
|
||||
|
||||
static struct kset acpi_namespace_kset = {
|
||||
|
|
@ -108,7 +108,7 @@ static struct kset acpi_namespace_kset = {
|
|||
},
|
||||
.subsys = &acpi_subsys,
|
||||
.ktype = &ktype_acpi_ns,
|
||||
.hotplug_ops = &namespace_hotplug_ops,
|
||||
.uevent_ops = &namespace_uevent_ops,
|
||||
};
|
||||
|
||||
static void acpi_device_register(struct acpi_device *device,
|
||||
|
|
@ -347,7 +347,7 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
|
|||
}
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
ACPI hotplug sysfs device file support
|
||||
ACPI sysfs device file support
|
||||
-------------------------------------------------------------------------- */
|
||||
static ssize_t acpi_eject_store(struct acpi_device *device,
|
||||
const char *buf, size_t count);
|
||||
|
|
|
|||
Loading…
Reference in a new issue