firewire: sbp2: remove a workaround for Momobay FX-3A
[sfrench/cifs-2.6.git] / drivers / firewire / sbp2.c
index 8d51568ee14344ee1e9e4ac11f690ae7a2c1d6a2..50f0176de61590e82b5ac2c0420139b8fe3bf1ea 100644 (file)
@@ -354,8 +354,7 @@ static const struct {
        /* DViCO Momobay FX-3A with TSB42AA9A bridge */ {
                .firmware_revision      = 0x002800,
                .model                  = 0x000000,
-               .workarounds            = SBP2_WORKAROUND_DELAY_INQUIRY |
-                                         SBP2_WORKAROUND_POWER_CONDITION,
+               .workarounds            = SBP2_WORKAROUND_POWER_CONDITION,
        },
        /* Initio bridges, actually only needed for some older ones */ {
                .firmware_revision      = 0x000200,
@@ -425,19 +424,20 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request,
        struct sbp2_logical_unit *lu = callback_data;
        struct sbp2_orb *orb;
        struct sbp2_status status;
-       size_t header_size;
        unsigned long flags;
 
        if (tcode != TCODE_WRITE_BLOCK_REQUEST ||
-           length == 0 || length > sizeof(status)) {
+           length < 8 || length > sizeof(status)) {
                fw_send_response(card, request, RCODE_TYPE_ERROR);
                return;
        }
 
-       header_size = min(length, 2 * sizeof(u32));
-       fw_memcpy_from_be32(&status, payload, header_size);
-       if (length > header_size)
-               memcpy(status.data, payload + 8, length - header_size);
+       status.status  = be32_to_cpup(payload);
+       status.orb_low = be32_to_cpup(payload + 4);
+       memset(status.data, 0, sizeof(status.data));
+       if (length > 8)
+               memcpy(status.data, payload + 8, length - 8);
+
        if (STATUS_GET_SOURCE(status) == 2 || STATUS_GET_SOURCE(status) == 3) {
                fw_notify("non-orb related status write, not handled\n");
                fw_send_response(card, request, RCODE_COMPLETE);
@@ -456,12 +456,12 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request,
        }
        spin_unlock_irqrestore(&card->lock, flags);
 
-       if (&orb->link != &lu->orb_list)
+       if (&orb->link != &lu->orb_list) {
                orb->callback(orb, &status);
-       else
+               kref_put(&orb->kref, free_orb);
+       } else {
                fw_error("status write for unknown orb\n");
-
-       kref_put(&orb->kref, free_orb);
+       }
 
        fw_send_response(card, request, RCODE_COMPLETE);
 }