ACPI / dock: Add .uevent() callback to struct acpi_hotplug_context
In order to avoid the need to register special ACPI dock
operations for SATA devices add a .uevent() callback pointer to
struct acpi_hotplug_context and make dock_hotplug_event() use that
callback if available. Also rename the existing .event() callback
in struct acpi_hotplug_context to .notify() to avoid possible
confusion in the future.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
index 78c4ee7..a88fad9 100644
--- a/drivers/acpi/dock.c
+++ b/drivers/acpi/dock.c
@@ -203,10 +203,19 @@
fixup(adev);
return;
}
+ } else if (cb_type == DOCK_CALL_UEVENT) {
+ void (*uevent)(struct acpi_device *, u32);
+
+ uevent = adev->hp->uevent;
+ if (uevent) {
+ acpi_unlock_hp_context();
+ uevent(adev, event);
+ return;
+ }
} else {
int (*notify)(struct acpi_device *, u32);
- notify = adev->hp->event;
+ notify = adev->hp->notify;
if (notify) {
acpi_unlock_hp_context();
notify(adev, event);