diff options
| author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2006-12-07 16:40:33 -0500 |
|---|---|---|
| committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2006-12-07 16:40:33 -0500 |
| commit | d19c77641412a257fa651662b96fec826e9e7e60 (patch) | |
| tree | ddd27573b7eff2e032fb76826b37514b351a0113 | |
| parent | 424a9642b8b436bba04ad5d2d254b43757166cdf (diff) | |
ieee1394: sbp2: delayed_work -> work_struct
This work is not delayed.
Also bring the code format in a state which reduces my work to merge
pending sbp2 patchs.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
| -rw-r--r-- | drivers/ieee1394/sbp2.c | 26 | ||||
| -rw-r--r-- | drivers/ieee1394/sbp2.h | 2 |
2 files changed, 12 insertions, 16 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 | ||
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h index 7b4242024665..5483b458bd77 100644 --- a/drivers/ieee1394/sbp2.h +++ b/drivers/ieee1394/sbp2.h | |||
| @@ -342,7 +342,7 @@ struct scsi_id_instance_data { | |||
| 342 | unsigned workarounds; | 342 | unsigned workarounds; |
| 343 | 343 | ||
| 344 | atomic_t state; | 344 | atomic_t state; |
| 345 | struct delayed_work protocol_work; | 345 | struct work_struct protocol_work; |
| 346 | }; | 346 | }; |
| 347 | 347 | ||
| 348 | /* For use in scsi_id_instance_data.state */ | 348 | /* For use in scsi_id_instance_data.state */ |
