diff options
Diffstat (limited to 'drivers/ieee1394')
-rw-r--r-- | drivers/ieee1394/hosts.c | 9 | ||||
-rw-r--r-- | drivers/ieee1394/hosts.h | 2 | ||||
-rw-r--r-- | drivers/ieee1394/sbp2.c | 28 | ||||
-rw-r--r-- | drivers/ieee1394/sbp2.h | 2 |
4 files changed, 23 insertions, 18 deletions
diff --git a/drivers/ieee1394/hosts.c b/drivers/ieee1394/hosts.c index d90a3a1898c0..8f4378a1631c 100644 --- a/drivers/ieee1394/hosts.c +++ b/drivers/ieee1394/hosts.c | |||
@@ -31,9 +31,10 @@ | |||
31 | #include "config_roms.h" | 31 | #include "config_roms.h" |
32 | 32 | ||
33 | 33 | ||
34 | static void delayed_reset_bus(void * __reset_info) | 34 | static void delayed_reset_bus(struct work_struct *work) |
35 | { | 35 | { |
36 | struct hpsb_host *host = (struct hpsb_host*)__reset_info; | 36 | struct hpsb_host *host = |
37 | container_of(work, struct hpsb_host, delayed_reset.work); | ||
37 | int generation = host->csr.generation + 1; | 38 | int generation = host->csr.generation + 1; |
38 | 39 | ||
39 | /* The generation field rolls over to 2 rather than 0 per IEEE | 40 | /* The generation field rolls over to 2 rather than 0 per IEEE |
@@ -145,7 +146,7 @@ struct hpsb_host *hpsb_alloc_host(struct hpsb_host_driver *drv, size_t extra, | |||
145 | 146 | ||
146 | atomic_set(&h->generation, 0); | 147 | atomic_set(&h->generation, 0); |
147 | 148 | ||
148 | INIT_WORK(&h->delayed_reset, delayed_reset_bus, h); | 149 | INIT_DELAYED_WORK(&h->delayed_reset, delayed_reset_bus); |
149 | 150 | ||
150 | init_timer(&h->timeout); | 151 | init_timer(&h->timeout); |
151 | h->timeout.data = (unsigned long) h; | 152 | h->timeout.data = (unsigned long) h; |
@@ -234,7 +235,7 @@ int hpsb_update_config_rom_image(struct hpsb_host *host) | |||
234 | * Config ROM in the near future. */ | 235 | * Config ROM in the near future. */ |
235 | reset_delay = HZ; | 236 | reset_delay = HZ; |
236 | 237 | ||
237 | PREPARE_WORK(&host->delayed_reset, delayed_reset_bus, host); | 238 | PREPARE_DELAYED_WORK(&host->delayed_reset, delayed_reset_bus); |
238 | schedule_delayed_work(&host->delayed_reset, reset_delay); | 239 | schedule_delayed_work(&host->delayed_reset, reset_delay); |
239 | 240 | ||
240 | return 0; | 241 | return 0; |
diff --git a/drivers/ieee1394/hosts.h b/drivers/ieee1394/hosts.h index bc6dbfadb891..d553e38c9543 100644 --- a/drivers/ieee1394/hosts.h +++ b/drivers/ieee1394/hosts.h | |||
@@ -62,7 +62,7 @@ struct hpsb_host { | |||
62 | struct class_device class_dev; | 62 | struct class_device class_dev; |
63 | 63 | ||
64 | int update_config_rom; | 64 | int update_config_rom; |
65 | struct work_struct delayed_reset; | 65 | struct delayed_work delayed_reset; |
66 | unsigned int config_roms; | 66 | unsigned int config_roms; |
67 | 67 | ||
68 | struct list_head addr_space; | 68 | struct list_head addr_space; |
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 6986ac188281..cd156d4e779e 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
@@ -493,20 +493,25 @@ static void sbp2util_notify_fetch_agent(struct scsi_id_instance_data *scsi_id, | |||
493 | scsi_unblock_requests(scsi_id->scsi_host); | 493 | scsi_unblock_requests(scsi_id->scsi_host); |
494 | } | 494 | } |
495 | 495 | ||
496 | static void sbp2util_write_orb_pointer(void *p) | 496 | static void sbp2util_write_orb_pointer(struct work_struct *work) |
497 | { | 497 | { |
498 | struct scsi_id_instance_data *scsi_id = | ||
499 | container_of(work, struct scsi_id_instance_data, | ||
500 | protocol_work.work); | ||
498 | quadlet_t data[2]; | 501 | quadlet_t data[2]; |
499 | 502 | ||
500 | data[0] = ORB_SET_NODE_ID( | 503 | data[0] = ORB_SET_NODE_ID(scsi_id->hi->host->node_id); |
501 | ((struct scsi_id_instance_data *)p)->hi->host->node_id); | 504 | data[1] = scsi_id->last_orb_dma; |
502 | data[1] = ((struct scsi_id_instance_data *)p)->last_orb_dma; | ||
503 | sbp2util_cpu_to_be32_buffer(data, 8); | 505 | sbp2util_cpu_to_be32_buffer(data, 8); |
504 | sbp2util_notify_fetch_agent(p, SBP2_ORB_POINTER_OFFSET, data, 8); | 506 | sbp2util_notify_fetch_agent(scsi_id, SBP2_ORB_POINTER_OFFSET, data, 8); |
505 | } | 507 | } |
506 | 508 | ||
507 | static void sbp2util_write_doorbell(void *p) | 509 | static void sbp2util_write_doorbell(struct work_struct *work) |
508 | { | 510 | { |
509 | sbp2util_notify_fetch_agent(p, SBP2_DOORBELL_OFFSET, NULL, 4); | 511 | struct scsi_id_instance_data *scsi_id = |
512 | container_of(work, struct scsi_id_instance_data, | ||
513 | protocol_work.work); | ||
514 | sbp2util_notify_fetch_agent(scsi_id, SBP2_DOORBELL_OFFSET, NULL, 4); | ||
510 | } | 515 | } |
511 | 516 | ||
512 | /* | 517 | /* |
@@ -843,7 +848,7 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud | |||
843 | INIT_LIST_HEAD(&scsi_id->scsi_list); | 848 | INIT_LIST_HEAD(&scsi_id->scsi_list); |
844 | spin_lock_init(&scsi_id->sbp2_command_orb_lock); | 849 | spin_lock_init(&scsi_id->sbp2_command_orb_lock); |
845 | atomic_set(&scsi_id->state, SBP2LU_STATE_RUNNING); | 850 | atomic_set(&scsi_id->state, SBP2LU_STATE_RUNNING); |
846 | INIT_WORK(&scsi_id->protocol_work, NULL, NULL); | 851 | INIT_DELAYED_WORK(&scsi_id->protocol_work, NULL); |
847 | 852 | ||
848 | ud->device.driver_data = scsi_id; | 853 | ud->device.driver_data = scsi_id; |
849 | 854 | ||
@@ -2047,11 +2052,10 @@ static void sbp2_link_orb_command(struct scsi_id_instance_data *scsi_id, | |||
2047 | * We do not accept new commands until the job is over. | 2052 | * We do not accept new commands until the job is over. |
2048 | */ | 2053 | */ |
2049 | scsi_block_requests(scsi_id->scsi_host); | 2054 | scsi_block_requests(scsi_id->scsi_host); |
2050 | PREPARE_WORK(&scsi_id->protocol_work, | 2055 | PREPARE_DELAYED_WORK(&scsi_id->protocol_work, |
2051 | last_orb ? sbp2util_write_doorbell: | 2056 | last_orb ? sbp2util_write_doorbell: |
2052 | sbp2util_write_orb_pointer, | 2057 | sbp2util_write_orb_pointer); |
2053 | scsi_id); | 2058 | schedule_delayed_work(&scsi_id->protocol_work, 0); |
2054 | schedule_work(&scsi_id->protocol_work); | ||
2055 | } | 2059 | } |
2056 | } | 2060 | } |
2057 | 2061 | ||
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h index abbe48e646c3..1b16d6b9cf11 100644 --- a/drivers/ieee1394/sbp2.h +++ b/drivers/ieee1394/sbp2.h | |||
@@ -348,7 +348,7 @@ struct scsi_id_instance_data { | |||
348 | unsigned workarounds; | 348 | unsigned workarounds; |
349 | 349 | ||
350 | atomic_t state; | 350 | atomic_t state; |
351 | struct work_struct protocol_work; | 351 | struct delayed_work protocol_work; |
352 | }; | 352 | }; |
353 | 353 | ||
354 | /* For use in scsi_id_instance_data.state */ | 354 | /* For use in scsi_id_instance_data.state */ |