diff options
Diffstat (limited to 'drivers/ieee1394/sbp2.c')
-rw-r--r-- | drivers/ieee1394/sbp2.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 6bd26a91111e..5156b88b0f2a 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
@@ -462,23 +462,18 @@ static void sbp2util_notify_fetch_agent(struct scsi_id_instance_data *scsi_id, | |||
462 | 462 | ||
463 | static void sbp2util_write_orb_pointer(struct work_struct *work) | 463 | static void sbp2util_write_orb_pointer(struct work_struct *work) |
464 | { | 464 | { |
465 | struct scsi_id_instance_data *scsi_id = | ||
466 | container_of(work, struct scsi_id_instance_data, | ||
467 | protocol_work.work); | ||
468 | quadlet_t data[2]; | 465 | quadlet_t data[2]; |
469 | 466 | ||
470 | data[0] = ORB_SET_NODE_ID(scsi_id->hi->host->node_id); | 467 | data[0] = ORB_SET_NODE_ID( |
471 | data[1] = scsi_id->last_orb_dma; | 468 | (container_of(work, struct scsi_id_instance_data, protocol_work))->hi->host->node_id); |
469 | data[1] = (container_of(work, struct scsi_id_instance_data, protocol_work))->last_orb_dma; | ||
472 | sbp2util_cpu_to_be32_buffer(data, 8); | 470 | sbp2util_cpu_to_be32_buffer(data, 8); |
473 | sbp2util_notify_fetch_agent(scsi_id, SBP2_ORB_POINTER_OFFSET, data, 8); | 471 | sbp2util_notify_fetch_agent(container_of(work, struct scsi_id_instance_data, protocol_work), SBP2_ORB_POINTER_OFFSET, data, 8); |
474 | } | 472 | } |
475 | 473 | ||
476 | static void sbp2util_write_doorbell(struct work_struct *work) | 474 | static void sbp2util_write_doorbell(struct work_struct *work) |
477 | { | 475 | { |
478 | struct scsi_id_instance_data *scsi_id = | 476 | sbp2util_notify_fetch_agent(container_of(work, struct scsi_id_instance_data, protocol_work), SBP2_DOORBELL_OFFSET, NULL, 4); |
479 | container_of(work, struct scsi_id_instance_data, | ||
480 | protocol_work.work); | ||
481 | sbp2util_notify_fetch_agent(scsi_id, SBP2_DOORBELL_OFFSET, NULL, 4); | ||
482 | } | 477 | } |
483 | 478 | ||
484 | /* | 479 | /* |
@@ -795,7 +790,7 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud | |||
795 | INIT_LIST_HEAD(&scsi_id->scsi_list); | 790 | INIT_LIST_HEAD(&scsi_id->scsi_list); |
796 | spin_lock_init(&scsi_id->sbp2_command_orb_lock); | 791 | spin_lock_init(&scsi_id->sbp2_command_orb_lock); |
797 | atomic_set(&scsi_id->state, SBP2LU_STATE_RUNNING); | 792 | atomic_set(&scsi_id->state, SBP2LU_STATE_RUNNING); |
798 | INIT_DELAYED_WORK(&scsi_id->protocol_work, NULL); | 793 | INIT_WORK(&scsi_id->protocol_work, NULL); |
799 | 794 | ||
800 | ud->device.driver_data = scsi_id; | 795 | ud->device.driver_data = scsi_id; |
801 | 796 | ||
@@ -1578,7 +1573,7 @@ static int sbp2_agent_reset(struct scsi_id_instance_data *scsi_id, int wait) | |||
1578 | int retval; | 1573 | int retval; |
1579 | unsigned long flags; | 1574 | unsigned long flags; |
1580 | 1575 | ||
1581 | cancel_delayed_work(&scsi_id->protocol_work); | 1576 | /* cancel_delayed_work(&scsi_id->protocol_work); */ |
1582 | if (wait) | 1577 | if (wait) |
1583 | flush_scheduled_work(); | 1578 | flush_scheduled_work(); |
1584 | 1579 | ||
@@ -1889,10 +1884,11 @@ static void sbp2_link_orb_command(struct scsi_id_instance_data *scsi_id, | |||
1889 | * We do not accept new commands until the job is over. | 1884 | * We do not accept new commands until the job is over. |
1890 | */ | 1885 | */ |
1891 | scsi_block_requests(scsi_id->scsi_host); | 1886 | scsi_block_requests(scsi_id->scsi_host); |
1892 | PREPARE_DELAYED_WORK(&scsi_id->protocol_work, | 1887 | PREPARE_WORK(&scsi_id->protocol_work, |
1893 | last_orb ? sbp2util_write_doorbell: | 1888 | last_orb ? sbp2util_write_doorbell: |
1894 | sbp2util_write_orb_pointer); | 1889 | sbp2util_write_orb_pointer |
1895 | schedule_delayed_work(&scsi_id->protocol_work, 0); | 1890 | /* */); |
1891 | schedule_work(&scsi_id->protocol_work); | ||
1896 | } | 1892 | } |
1897 | } | 1893 | } |
1898 | 1894 | ||