]> err.no Git - linux-2.6/commitdiff
sbp2: fix deregistration of status fifo address space
authorBen Collins <bcollins@ubuntu.com>
Mon, 12 Jun 2006 22:15:20 +0000 (18:15 -0400)
committerBen Collins <bcollins@ubuntu.com>
Mon, 12 Jun 2006 22:15:20 +0000 (18:15 -0400)
The proper designator of an invalid CSR address is ~(u64)0, not (u64)0.
Use the correct value in initialization and deregistration.
Also, scsi_id->sbp2_lun does not need to be initialized twice.
(scsi_id was kzalloc'd.)

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
drivers/ieee1394/sbp2.c

index 251656ec7d922cd14513edf043ed2d553ecebb3d..975a56bfab3d65176540d5379d588e57b7f7446c 100644 (file)
@@ -794,12 +794,12 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
        scsi_id->ud = ud;
        scsi_id->speed_code = IEEE1394_SPEED_100;
        scsi_id->max_payload_size = sbp2_speedto_max_payload[IEEE1394_SPEED_100];
+       scsi_id->status_fifo_addr = ~0ULL;
        atomic_set(&scsi_id->sbp2_login_complete, 0);
        INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_inuse);
        INIT_LIST_HEAD(&scsi_id->sbp2_command_orb_completed);
        INIT_LIST_HEAD(&scsi_id->scsi_list);
        spin_lock_init(&scsi_id->sbp2_command_orb_lock);
-       scsi_id->sbp2_lun = 0;
 
        ud->device.driver_data = scsi_id;
 
@@ -1090,7 +1090,7 @@ static void sbp2_remove_device(struct scsi_id_instance_data *scsi_id)
                SBP2_DMA_FREE("single query logins data");
        }
 
-       if (scsi_id->status_fifo_addr)
+       if (scsi_id->status_fifo_addr != ~0ULL)
                hpsb_unregister_addrspace(&sbp2_highlevel, hi->host,
                        scsi_id->status_fifo_addr);