[SCSI] pm8001: simplify workqueue usage
authorTejun Heo <tj@kernel.org>
Mon, 24 Jan 2011 13:57:29 +0000 (14:57 +0100)
committerJames Bottomley <James.Bottomley@suse.de>
Sat, 12 Feb 2011 16:31:03 +0000 (10:31 -0600)
commit429305e4650c5d3395c21ca183455a3f3e3568af
tree22f80762c0a2d3dcca39bde7aec19e5401a3d292
parenta684b8da35a429a246ec2a91e2742bdff5209709
[SCSI] pm8001: simplify workqueue usage

pm8001 manages its own list of pending works and cancel them on device
free.  It is unnecessarily complex and has a race condition - the
works are canceled but not synced, so the work could still be running
during and after the data structures are freed.

This patch simplifies workqueue usage.

* A driver specific workqueue pm8001_wq is created to serve these
  work items.

* To avoid confusion, the "queue" suffixes are dropped from work items
  and functions.

* Delayed queueing was never used.  pm8001_work now uses work_struct
  instead.

* The driver no longer keeps track of pending works.  All pm8001_works
  are queued to pm8001_wq and the workqueue is flushed as necessary.

flush_scheduled_work() usage is removed during conversion.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Jack Wang <jack_wang@usish.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/pm8001/pm8001_hwi.c
drivers/scsi/pm8001/pm8001_init.c
drivers/scsi/pm8001/pm8001_sas.h