aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/sbp2.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2009-10-07 18:41:10 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2009-10-14 17:10:48 -0400
commit9fb551bf72929b316abb6d96cfb2ec05e896042a (patch)
tree63c52c2b3c6ee05b11176ce16fa3eb9c7b69edad /drivers/firewire/sbp2.c
parent7e44c0b56b07a5e34de9943cfb2fee72e71a9f0e (diff)
firewire: normalize style of queue_work wrappers
A few stylistic changes to unify some code patterns in the subsystem: - The similar queue_delayed_work helpers fw_schedule_bm_work, schedule_iso_resource, and sbp2_queue_work now have the same call convention. - Two conditional calls of schedule_iso_resource are factored into another small helper. - An sbp2_target_get helper is added as counterpart to sbp2_target_put. Object size of firewire-core is decreased a little bit, object size of firewire-sbp2 remains unchanged. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/sbp2.c')
-rw-r--r--drivers/firewire/sbp2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c
index 98dbbda3ad41..d485cdd8cbac 100644
--- a/drivers/firewire/sbp2.c
+++ b/drivers/firewire/sbp2.c
@@ -820,20 +820,25 @@ static void sbp2_release_target(struct kref *kref)
820 fw_device_put(device); 820 fw_device_put(device);
821} 821}
822 822
823static struct workqueue_struct *sbp2_wq; 823static void sbp2_target_get(struct sbp2_target *tgt)
824{
825 kref_get(&tgt->kref);
826}
824 827
825static void sbp2_target_put(struct sbp2_target *tgt) 828static void sbp2_target_put(struct sbp2_target *tgt)
826{ 829{
827 kref_put(&tgt->kref, sbp2_release_target); 830 kref_put(&tgt->kref, sbp2_release_target);
828} 831}
829 832
833static struct workqueue_struct *sbp2_wq;
834
830/* 835/*
831 * Always get the target's kref when scheduling work on one its units. 836 * Always get the target's kref when scheduling work on one its units.
832 * Each workqueue job is responsible to call sbp2_target_put() upon return. 837 * Each workqueue job is responsible to call sbp2_target_put() upon return.
833 */ 838 */
834static void sbp2_queue_work(struct sbp2_logical_unit *lu, unsigned long delay) 839static void sbp2_queue_work(struct sbp2_logical_unit *lu, unsigned long delay)
835{ 840{
836 kref_get(&lu->tgt->kref); 841 sbp2_target_get(lu->tgt);
837 if (!queue_delayed_work(sbp2_wq, &lu->work, delay)) 842 if (!queue_delayed_work(sbp2_wq, &lu->work, delay))
838 sbp2_target_put(lu->tgt); 843 sbp2_target_put(lu->tgt);
839} 844}