lkml.org 
[lkml]   [2013]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v8 18/22] PCI, acpiphp: Use acpi_hp_work
    Date
    Remove local defined acpiphp_hp_work.

    Signed-off-by: Yinghai Lu <yinghai@kernel.org>
    Cc: Len Brown <lenb@kernel.org>
    Cc: linux-acpi@vger.kernel.org
    ---
    drivers/pci/hotplug/acpiphp_glue.c | 42 ++++++------------------------------
    1 file changed, 6 insertions(+), 36 deletions(-)

    diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
    index 30467ec..82e8883 100644
    --- a/drivers/pci/hotplug/acpiphp_glue.c
    +++ b/drivers/pci/hotplug/acpiphp_glue.c
    @@ -1197,34 +1197,6 @@ check_sub_bridges(acpi_handle handle, u32 lvl, void *context, void **rv)
    return AE_OK ;
    }

    -struct acpiphp_hp_work {
    - struct work_struct work;
    - acpi_handle handle;
    - u32 type;
    - void *context;
    -};
    -
    -static void alloc_acpiphp_hp_work(acpi_handle handle, u32 type,
    - void *context,
    - void (*func)(struct work_struct *work))
    -{
    - struct acpiphp_hp_work *hp_work;
    - int ret;
    -
    - hp_work = kmalloc(sizeof(*hp_work), GFP_KERNEL);
    - if (!hp_work)
    - return;
    -
    - hp_work->handle = handle;
    - hp_work->type = type;
    - hp_work->context = context;
    -
    - INIT_WORK(&hp_work->work, func);
    - ret = queue_work(kacpi_hotplug_wq, &hp_work->work);
    - if (!ret)
    - kfree(hp_work);
    -}
    -
    static void _handle_hotplug_event_bridge(struct work_struct *work)
    {
    struct acpiphp_bridge *bridge;
    @@ -1233,11 +1205,11 @@ static void _handle_hotplug_event_bridge(struct work_struct *work)
    .pointer = objname };
    struct acpi_device *device;
    int num_sub_bridges = 0;
    - struct acpiphp_hp_work *hp_work;
    + struct acpi_hp_work *hp_work;
    acpi_handle handle;
    u32 type;

    - hp_work = container_of(work, struct acpiphp_hp_work, work);
    + hp_work = container_of(work, struct acpi_hp_work, work);
    handle = hp_work->handle;
    type = hp_work->type;

    @@ -1340,8 +1312,7 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type,
    * For now just re-add this work to the kacpi_hotplug_wq so we
    * don't deadlock on hotplug actions.
    */
    - alloc_acpiphp_hp_work(handle, type, context,
    - _handle_hotplug_event_bridge);
    + alloc_acpi_hp_work(handle, type, context, _handle_hotplug_event_bridge);
    }

    static void _handle_hotplug_event_func(struct work_struct *work)
    @@ -1350,12 +1321,12 @@ static void _handle_hotplug_event_func(struct work_struct *work)
    char objname[64];
    struct acpi_buffer buffer = { .length = sizeof(objname),
    .pointer = objname };
    - struct acpiphp_hp_work *hp_work;
    + struct acpi_hp_work *hp_work;
    acpi_handle handle;
    u32 type;
    void *context;

    - hp_work = container_of(work, struct acpiphp_hp_work, work);
    + hp_work = container_of(work, struct acpi_hp_work, work);
    handle = hp_work->handle;
    type = hp_work->type;
    context = hp_work->context;
    @@ -1416,8 +1387,7 @@ static void handle_hotplug_event_func(acpi_handle handle, u32 type,
    * For now just re-add this work to the kacpi_hotplug_wq so we
    * don't deadlock on hotplug actions.
    */
    - alloc_acpiphp_hp_work(handle, type, context,
    - _handle_hotplug_event_func);
    + alloc_acpi_hp_work(handle, type, context, _handle_hotplug_event_func);
    }

    static struct acpi_pci_driver acpi_pci_hp_driver = {
    --
    1.7.10.4


    \
     
     \ /
      Last update: 2013-01-12 00:41    [W:3.527 / U:0.080 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site