megaraid: convert to work_struct
Subsystems (2)
PATCH 1/1 megaraid: convert to work_struct
There's no need to use delayed work, convert to use work_struct and cancel_work_sync().
Requested-by Tejun Heo <[email protected]>
Signed-off-by Xiaotian Feng <[email protected]>
Cc Neela Syam Kolli <[email protected]>
Cc "James E.J. Bottomley" <[email protected]>
--- drivers/scsi/megaraid/megaraid_sas.h | 2 +- drivers/scsi/megaraid/megaraid_sas_base.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-)
drivers/scsi/megaraid/megaraid_sas.h +1 -1
@@ -1276,7 +1276,7 @@ struct megasas_evt_detail { } __attribute__ ((packed));struct megasas_aen_event { -struct delayed_work hotplug_work; +struct work_struct hotplug_work;struct megasas_instance *instance; };
drivers/scsi/megaraid/megaraid_sas_base.c +7 -8
@@ -2060,9 +2060,8 @@ megasas_service_aen(struct megasas_instance *instance, struct megasas_cmd *cmd) }else { ev->instance = instance; instance->ev = ev; -INIT_DELAYED_WORK (&ev->hotplug_work, - megasas_aen_polling); -schedule_delayed_work (&ev->hotplug_work,0 ); +INIT_WORK (&ev->hotplug_work, megasas_aen_polling); +schedule_work (&ev->hotplug_work); } } }
@@ -4349,10 +4348,10 @@ megasas_suspend(struct pci_dev *pdev, pm_message_t state)megasas_flush_cache (instance);megasas_shutdown_controller (instance,MR_DCMD_HIBERNATE_SHUTDOWN ); -/* cancel the delayed work if this work still in queue */ +/* cancel the work if this work still in queue */ if (instance->ev !=NULL ) {struct megasas_aen_event *ev = instance->ev; -cancel_delayed_work_sync (&ev->hotplug_work); +cancel_work_sync (&ev->hotplug_work); instance->ev =NULL ; }
@@ -4541,10 +4540,10 @@ static void __devexit megasas_detach_one(struct pci_dev *pdev)megasas_flush_cache (instance);megasas_shutdown_controller (instance,MR_DCMD_CTRL_SHUTDOWN ); -/* cancel the delayed work if this work still in queue*/ +/* cancel the work if this work still in queue*/ if (instance->ev !=NULL ) {struct megasas_aen_event *ev = instance->ev; -cancel_delayed_work_sync (&ev->hotplug_work); +cancel_work_sync (&ev->hotplug_work); instance->ev =NULL ; }
@@ -5188,7 +5187,7 @@ static void megasas_aen_polling(struct work_struct *work) {struct megasas_aen_event *ev = - container_of(work, struct megasas_aen_event, hotplug_work.work); + container_of(work, struct megasas_aen_event, hotplug_work);struct megasas_instance *instance = ev->instance;union megasas_evt_class_locale class_locale;struct Scsi_Host *host;
Signature · 1 line
1.7.9.5
Quoted 9 lines · Xiaotian Feng
There's no need to use delayed work, convert to use
work_structandcancel_work_sync().Requested-by Tejun Heo <[email protected]>Signed-off-by Xiaotian Feng <[email protected]>Cc Neela Syam Kolli <[email protected]>Cc "James E.J. Bottomley" <[email protected]>
Acked-by Tejun Heo <[email protected]>
Thanks.
Signature · 1 line
tejun