Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firewire: core: code refactoring whether root node is cycle master capable

The check of cycle master capability in root node is currently just in a
condition branch. In this case, the required variable should be within the
branch.

This commit is just for the purpose.

Link: https://lore.kernel.org/r/20250908012108.514698-12-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>

+3 -5
+3 -5
drivers/firewire/core-card.c
··· 289 289 63, 5, 7, 8, 10, 13, 16, 18, 21, 24, 26, 29, 32, 35, 37, 40 290 290 }; 291 291 struct fw_card *card __free(card_unref) = from_work(card, work, bm_work.work); 292 - struct fw_device *root_device; 293 292 struct fw_node *root_node __free(node_unref) = NULL; 294 293 int root_id, new_root_id, irm_id, local_id; 295 294 int expected_gap_count, generation, grace; 296 295 bool do_reset = false; 297 - bool root_device_is_cmc; 298 296 299 297 lockdep_assert_held(&card->lock); 300 298 ··· 306 308 generation = card->generation; 307 309 308 310 root_node = fw_node_get(card->root_node); 309 - root_device = fw_node_get_device(root_node); 310 - root_device_is_cmc = root_device && root_device->cmc; 311 311 312 312 root_id = root_node->node_id; 313 313 irm_id = card->irm_node->node_id; ··· 515 519 reset_bus(card, card_gap_count != 0); 516 520 /* Will allocate broadcast channel after the reset. */ 517 521 } else { 522 + struct fw_device *root_device = fw_node_get_device(root_node); 523 + 518 524 spin_unlock_irq(&card->lock); 519 525 520 - if (root_device_is_cmc) { 526 + if (root_device && root_device->cmc) { 521 527 // Make sure that the cycle master sends cycle start packets. 522 528 __be32 data = cpu_to_be32(CSR_STATE_BIT_CMSTR); 523 529 int rcode = fw_run_transaction(card, TCODE_WRITE_QUADLET_REQUEST,