ACPI / hotplug: Simplify acpi_set_hp_context()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 15 Jul 2014 20:03:22 +0000 (22:03 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 15 Jul 2014 23:45:40 +0000 (01:45 +0200)
Since all of the acpi_set_hp_context() callers pass at least one NULL
function pointer and one caller passes NULL function pointers only
to it, drop function pointer arguments from acpi_set_hp_context()
and make the callers initialize the function pointers in struct
acpi_hotplug_context by themselves before passing it to
acpi_set_hp_context().

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/acpi/scan.c
drivers/pci/hotplug/acpiphp_glue.c
include/acpi/acpi_bus.h

index f775fa0d850feee4996b7e90bd6158c379841e1b..3ffc9306538bca385d0a7382e94438d27f9d0cf3 100644 (file)
@@ -77,7 +77,9 @@ void acpi_initialize_hp_context(struct acpi_device *adev,
                                void (*uevent)(struct acpi_device *, u32))
 {
        acpi_lock_hp_context();
-       acpi_set_hp_context(adev, hp, notify, uevent, NULL);
+       hp->notify = notify;
+       hp->uevent = uevent;
+       acpi_set_hp_context(adev, hp);
        acpi_unlock_hp_context();
 }
 EXPORT_SYMBOL_GPL(acpi_initialize_hp_context);
index 08043f9c1dd5c3d83d2f0af55f33c136461c2b9e..24a43d4e993334771e4553af7643ebb055694fcd 100644 (file)
@@ -80,8 +80,9 @@ static struct acpiphp_context *acpiphp_init_context(struct acpi_device *adev)
                return NULL;
 
        context->refcount = 1;
-       acpi_set_hp_context(adev, &context->hp, acpiphp_hotplug_notify, NULL,
-                           acpiphp_post_dock_fixup);
+       context->hp.notify = acpiphp_hotplug_notify;
+       context->hp.fixup = acpiphp_post_dock_fixup;
+       acpi_set_hp_context(adev, &context->hp);
        return context;
 }
 
@@ -876,7 +877,7 @@ void acpiphp_enumerate_slots(struct pci_bus *bus)
                        goto err;
 
                root_context->root_bridge = bridge;
-               acpi_set_hp_context(adev, &root_context->hp, NULL, NULL, NULL);
+               acpi_set_hp_context(adev, &root_context->hp);
        } else {
                struct acpiphp_context *context;
 
index b5714580801a54ac2c1c10ae2dcc2a0329042ed7..e0720a569b2c5e600f26599916e5ac33243b66a1 100644 (file)
@@ -372,15 +372,9 @@ static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta)
 }
 
 static inline void acpi_set_hp_context(struct acpi_device *adev,
-                                      struct acpi_hotplug_context *hp,
-                                      int (*notify)(struct acpi_device *, u32),
-                                      void (*uevent)(struct acpi_device *, u32),
-                                      void (*fixup)(struct acpi_device *))
+                                      struct acpi_hotplug_context *hp)
 {
        hp->self = adev;
-       hp->notify = notify;
-       hp->uevent = uevent;
-       hp->fixup = fixup;
        adev->hp = hp;
 }