diff options
| author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2026-10-18 00:33:39 +0900 |
|---|---|---|
| committer | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2026-10-18 00:33:39 +0900 |
| commit | ea0ee5f3bbad57bd776a67e3952600fdeb341c9c (patch) | |
| tree | 70bfaf972cc165f07224cba57c4d7e3c235cfc34 | |
| parent | 491eaa94eae15cfe2d58c336c92566c8a1d6d74f (diff) | |
| download | linux-next-ea0ee5f3bbad57bd776a67e3952600fdeb341c9c.tar.gz linux-next-ea0ee5f3bbad57bd776a67e3952600fdeb341c9c.zip | |
firewire: core: reuse helper function for scheduling error callbacks
The transaction layer has some code that can be replaced with the
existing helper function for scheduling error callbacks.
Link: https://lore.kernel.org/r/20261017153339.267337-3-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
| -rw-r--r-- | drivers/firewire/core-transaction.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index 3f7c4ec4d618..08536275be12 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -110,6 +110,14 @@ __must_not_hold(&card->transactions.lock) __t; \ }) +static void schedule_error_callback(struct fw_transaction *t, int rcode, u32 response_timestamp) +{ + t->rcode = rcode; + t->response_timestamp = response_timestamp; + + queue_work(t->card->async_wq, &t->error_work); +} + /** * fw_cancel_transaction: cancel transaction. * @card: interface where the transaction has been requested @@ -147,10 +155,9 @@ __must_not_hold(&card->transactions.lock) // Timestamping on behalf of hardware. (void)fw_card_read_cycle_time(card, &curr_cycle_time); - transaction->response_timestamp = cycle_time_to_ohci_tstamp(curr_cycle_time); - transaction->rcode = RCODE_CANCELLED; - queue_work(card->async_wq, &transaction->error_work); + schedule_error_callback(transaction, RCODE_CANCELLED, + cycle_time_to_ohci_tstamp(curr_cycle_time)); return 0; } @@ -169,14 +176,6 @@ static void error_callback_work(struct work_struct *work) invoke_callback(t, t->rcode, t->response_timestamp, NULL, 0); } -static void schedule_error_callback(struct fw_transaction *t, int rcode, u32 response_timestamp) -{ - t->rcode = rcode; - t->response_timestamp = response_timestamp; - - queue_work(t->card->async_wq, &t->error_work); -} - // card->transactions.lock must be released in advance. static void split_transaction_timeout_callback(struct timer_list *timer) { |
