]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/firewire/fw-card.c
Driver core: add uevent file for bus and driver
[linux-2.6-omap-h63xx.git] / drivers / firewire / fw-card.c
index b8404ee5314cbe9e12afa10c0da98cb630dd0058..3e9719948a8e7817658496929115fe52bda45473 100644 (file)
@@ -75,7 +75,7 @@ generate_config_rom(struct fw_card *card, size_t *config_rom_length)
         * the version stored in the OHCI registers.
         */
 
-       memset(config_rom, 0, sizeof config_rom);
+       memset(config_rom, 0, sizeof(config_rom));
        config_rom[0] = BIB_CRC_LENGTH(4) | BIB_INFO_LENGTH(4) | BIB_CRC(0);
        config_rom[1] = 0x31333934;
 
@@ -258,7 +258,7 @@ fw_card_bm_work(struct work_struct *work)
                fw_send_request(card, &bmd.t, TCODE_LOCK_COMPARE_SWAP,
                                irm_id, generation,
                                SCODE_100, CSR_REGISTER_BASE + CSR_BUS_MANAGER_ID,
-                               &bmd.lock, sizeof bmd.lock,
+                               &bmd.lock, sizeof(bmd.lock),
                                complete_bm_lock, &bmd);
                wait_for_completion(&bmd.done);
 
@@ -336,8 +336,11 @@ fw_card_bm_work(struct work_struct *work)
        }
 
  pick_me:
-       /* Now figure out what gap count to set. */
-       if (card->topology_type == FW_TOPOLOGY_A &&
+       /*
+        * Pick a gap count from 1394a table E-1.  The table doesn't cover
+        * the typically much larger 1394b beta repeater delays though.
+        */
+       if (!card->beta_repeaters_present &&
            card->root_node->max_hops < ARRAY_SIZE(gap_count_table))
                gap_count = gap_count_table[card->root_node->max_hops];
        else
@@ -407,11 +410,6 @@ fw_card_add(struct fw_card *card,
        card->link_speed = link_speed;
        card->guid = guid;
 
-       /* Activate link_on bit and contender bit in our self ID packets.*/
-       if (card->driver->update_phy_reg(card, 4, 0,
-                                        PHY_LINK_ACTIVE | PHY_CONTENDER) < 0)
-               return -EIO;
-
        /*
         * The subsystem grabs a reference when the card is added and
         * drops it when the driver calls fw_core_remove_card.
@@ -512,9 +510,11 @@ fw_core_remove_card(struct fw_card *card)
        /* Set up the dummy driver. */
        card->driver = &dummy_driver;
 
-       fw_flush_transactions(card);
-
        fw_destroy_nodes(card);
+       flush_scheduled_work();
+
+       fw_flush_transactions(card);
+       del_timer_sync(&card->flush_timer);
 
        fw_card_put(card);
 }