diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-02-20 19:10:27 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-02-20 19:10:27 -0500 |
commit | be27b3dcb02335ec093b81053fc8c84b32d3106e (patch) | |
tree | 473c5dcff60a8568d272da97830dbd0fb9e2fe8d /drivers/acpi | |
parent | edf5bf34d40804fbef32f240a79b74ffc69a658b (diff) |
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/dock.c | 11 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 8 |
2 files changed, 14 insertions, 5 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 78c4ee7a422e..a88fad9ff234 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -203,10 +203,19 @@ static void dock_hotplug_event(struct dock_dependent_device *dd, u32 event, | |||
203 | fixup(adev); | 203 | fixup(adev); |
204 | return; | 204 | return; |
205 | } | 205 | } |
206 | } else if (cb_type == DOCK_CALL_UEVENT) { | ||
207 | void (*uevent)(struct acpi_device *, u32); | ||
208 | |||
209 | uevent = adev->hp->uevent; | ||
210 | if (uevent) { | ||
211 | acpi_unlock_hp_context(); | ||
212 | uevent(adev, event); | ||
213 | return; | ||
214 | } | ||
206 | } else { | 215 | } else { |
207 | int (*notify)(struct acpi_device *, u32); | 216 | int (*notify)(struct acpi_device *, u32); |
208 | 217 | ||
209 | notify = adev->hp->event; | 218 | notify = adev->hp->notify; |
210 | if (notify) { | 219 | if (notify) { |
211 | acpi_unlock_hp_context(); | 220 | acpi_unlock_hp_context(); |
212 | notify(adev, event); | 221 | notify(adev, event); |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 518aae461a00..e7d951032f85 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -496,17 +496,17 @@ void acpi_device_hotplug(void *data, u32 src) | |||
496 | goto err_out; | 496 | goto err_out; |
497 | } | 497 | } |
498 | } else { | 498 | } else { |
499 | int (*event)(struct acpi_device *, u32); | 499 | int (*notify)(struct acpi_device *, u32); |
500 | 500 | ||
501 | acpi_lock_hp_context(); | 501 | acpi_lock_hp_context(); |
502 | event = adev->hp ? adev->hp->event : NULL; | 502 | notify = adev->hp ? adev->hp->notify : NULL; |
503 | acpi_unlock_hp_context(); | 503 | acpi_unlock_hp_context(); |
504 | /* | 504 | /* |
505 | * There may be additional notify handlers for device objects | 505 | * There may be additional notify handlers for device objects |
506 | * without the .event() callback, so ignore them here. | 506 | * without the .event() callback, so ignore them here. |
507 | */ | 507 | */ |
508 | if (event) | 508 | if (notify) |
509 | error = event(adev, src); | 509 | error = notify(adev, src); |
510 | else | 510 | else |
511 | goto out; | 511 | goto out; |
512 | } | 512 | } |