projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gpio: add flags argument to gpiod_get*() functions
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
firewire
/
sbp2.c
diff --git
a/drivers/firewire/sbp2.c
b/drivers/firewire/sbp2.c
index 281029daf98c7ea291886d46ecf05378bfa98718..7aef911fdc716d4874b7152b3c0d6e27bc8c1642 100644
(file)
--- a/
drivers/firewire/sbp2.c
+++ b/
drivers/firewire/sbp2.c
@@
-146,6
+146,7
@@
struct sbp2_logical_unit {
*/
int generation;
int retries;
*/
int generation;
int retries;
+ work_func_t workfn;
struct delayed_work work;
bool has_sdev;
bool blocked;
struct delayed_work work;
bool has_sdev;
bool blocked;
@@
-864,7
+865,7
@@
static void sbp2_login(struct work_struct *work)
/* set appropriate retry limit(s) in BUSY_TIMEOUT register */
sbp2_set_busy_timeout(lu);
/* set appropriate retry limit(s) in BUSY_TIMEOUT register */
sbp2_set_busy_timeout(lu);
-
PREPARE_DELAYED_WORK(&lu->work, sbp2_reconnect)
;
+
lu->workfn = sbp2_reconnect
;
sbp2_agent_reset(lu);
/* This was a re-login. */
sbp2_agent_reset(lu);
/* This was a re-login. */
@@
-918,7
+919,7
@@
static void sbp2_login(struct work_struct *work)
* If a bus reset happened, sbp2_update will have requeued
* lu->work already. Reset the work from reconnect to login.
*/
* If a bus reset happened, sbp2_update will have requeued
* lu->work already. Reset the work from reconnect to login.
*/
-
PREPARE_DELAYED_WORK(&lu->work, sbp2_login)
;
+
lu->workfn = sbp2_login
;
}
static void sbp2_reconnect(struct work_struct *work)
}
static void sbp2_reconnect(struct work_struct *work)
@@
-952,7
+953,7
@@
static void sbp2_reconnect(struct work_struct *work)
lu->retries++ >= 5) {
dev_err(tgt_dev(tgt), "failed to reconnect\n");
lu->retries = 0;
lu->retries++ >= 5) {
dev_err(tgt_dev(tgt), "failed to reconnect\n");
lu->retries = 0;
-
PREPARE_DELAYED_WORK(&lu->work, sbp2_login)
;
+
lu->workfn = sbp2_login
;
}
sbp2_queue_work(lu, DIV_ROUND_UP(HZ, 5));
}
sbp2_queue_work(lu, DIV_ROUND_UP(HZ, 5));
@@
-972,6
+973,13
@@
static void sbp2_reconnect(struct work_struct *work)
sbp2_conditionally_unblock(lu);
}
sbp2_conditionally_unblock(lu);
}
+static void sbp2_lu_workfn(struct work_struct *work)
+{
+ struct sbp2_logical_unit *lu = container_of(to_delayed_work(work),
+ struct sbp2_logical_unit, work);
+ lu->workfn(work);
+}
+
static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry)
{
struct sbp2_logical_unit *lu;
static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry)
{
struct sbp2_logical_unit *lu;
@@
-998,7
+1006,8
@@
static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry)
lu->blocked = false;
++tgt->dont_block;
INIT_LIST_HEAD(&lu->orb_list);
lu->blocked = false;
++tgt->dont_block;
INIT_LIST_HEAD(&lu->orb_list);
- INIT_DELAYED_WORK(&lu->work, sbp2_login);
+ lu->workfn = sbp2_login;
+ INIT_DELAYED_WORK(&lu->work, sbp2_lu_workfn);
list_add_tail(&lu->link, &tgt->lu_list);
return 0;
list_add_tail(&lu->link, &tgt->lu_list);
return 0;