diff options
author | Grant Likely <grant.likely@linaro.org> | 2014-03-31 03:10:55 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2014-03-31 03:10:55 -0400 |
commit | d88cf7d7b4240b8df170ba105e414e476fb51cce (patch) | |
tree | 7efe976da6e0ec854eb0eeda82c1e9a275b8c69f /drivers/firewire/sbp2.c | |
parent | 676e1b2fcd9dbb47a59baac13d089621d22c68b8 (diff) | |
parent | 6f976267da0e2c873c4b4aaacaf08266d1d1797d (diff) |
Merge remote-tracking branch 'robh/for-next' into devicetree/next
Diffstat (limited to 'drivers/firewire/sbp2.c')
-rw-r--r-- | drivers/firewire/sbp2.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index 281029daf98c..7aef911fdc71 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c | |||
@@ -146,6 +146,7 @@ struct sbp2_logical_unit { | |||
146 | */ | 146 | */ |
147 | int generation; | 147 | int generation; |
148 | int retries; | 148 | int retries; |
149 | work_func_t workfn; | ||
149 | struct delayed_work work; | 150 | struct delayed_work work; |
150 | bool has_sdev; | 151 | bool has_sdev; |
151 | bool blocked; | 152 | bool blocked; |
@@ -864,7 +865,7 @@ static void sbp2_login(struct work_struct *work) | |||
864 | /* set appropriate retry limit(s) in BUSY_TIMEOUT register */ | 865 | /* set appropriate retry limit(s) in BUSY_TIMEOUT register */ |
865 | sbp2_set_busy_timeout(lu); | 866 | sbp2_set_busy_timeout(lu); |
866 | 867 | ||
867 | PREPARE_DELAYED_WORK(&lu->work, sbp2_reconnect); | 868 | lu->workfn = sbp2_reconnect; |
868 | sbp2_agent_reset(lu); | 869 | sbp2_agent_reset(lu); |
869 | 870 | ||
870 | /* This was a re-login. */ | 871 | /* This was a re-login. */ |
@@ -918,7 +919,7 @@ static void sbp2_login(struct work_struct *work) | |||
918 | * If a bus reset happened, sbp2_update will have requeued | 919 | * If a bus reset happened, sbp2_update will have requeued |
919 | * lu->work already. Reset the work from reconnect to login. | 920 | * lu->work already. Reset the work from reconnect to login. |
920 | */ | 921 | */ |
921 | PREPARE_DELAYED_WORK(&lu->work, sbp2_login); | 922 | lu->workfn = sbp2_login; |
922 | } | 923 | } |
923 | 924 | ||
924 | static void sbp2_reconnect(struct work_struct *work) | 925 | static void sbp2_reconnect(struct work_struct *work) |
@@ -952,7 +953,7 @@ static void sbp2_reconnect(struct work_struct *work) | |||
952 | lu->retries++ >= 5) { | 953 | lu->retries++ >= 5) { |
953 | dev_err(tgt_dev(tgt), "failed to reconnect\n"); | 954 | dev_err(tgt_dev(tgt), "failed to reconnect\n"); |
954 | lu->retries = 0; | 955 | lu->retries = 0; |
955 | PREPARE_DELAYED_WORK(&lu->work, sbp2_login); | 956 | lu->workfn = sbp2_login; |
956 | } | 957 | } |
957 | sbp2_queue_work(lu, DIV_ROUND_UP(HZ, 5)); | 958 | sbp2_queue_work(lu, DIV_ROUND_UP(HZ, 5)); |
958 | 959 | ||
@@ -972,6 +973,13 @@ static void sbp2_reconnect(struct work_struct *work) | |||
972 | sbp2_conditionally_unblock(lu); | 973 | sbp2_conditionally_unblock(lu); |
973 | } | 974 | } |
974 | 975 | ||
976 | static void sbp2_lu_workfn(struct work_struct *work) | ||
977 | { | ||
978 | struct sbp2_logical_unit *lu = container_of(to_delayed_work(work), | ||
979 | struct sbp2_logical_unit, work); | ||
980 | lu->workfn(work); | ||
981 | } | ||
982 | |||
975 | static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry) | 983 | static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry) |
976 | { | 984 | { |
977 | struct sbp2_logical_unit *lu; | 985 | struct sbp2_logical_unit *lu; |
@@ -998,7 +1006,8 @@ static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry) | |||
998 | lu->blocked = false; | 1006 | lu->blocked = false; |
999 | ++tgt->dont_block; | 1007 | ++tgt->dont_block; |
1000 | INIT_LIST_HEAD(&lu->orb_list); | 1008 | INIT_LIST_HEAD(&lu->orb_list); |
1001 | INIT_DELAYED_WORK(&lu->work, sbp2_login); | 1009 | lu->workfn = sbp2_login; |
1010 | INIT_DELAYED_WORK(&lu->work, sbp2_lu_workfn); | ||
1002 | 1011 | ||
1003 | list_add_tail(&lu->link, &tgt->lu_list); | 1012 | list_add_tail(&lu->link, &tgt->lu_list); |
1004 | return 0; | 1013 | return 0; |