]> err.no Git - linux-2.6/commitdiff
ieee1394: sbp2: delayed_work -> work_struct
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Thu, 7 Dec 2006 21:40:33 +0000 (22:40 +0100)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Thu, 7 Dec 2006 21:40:33 +0000 (22:40 +0100)
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>
drivers/ieee1394/sbp2.c
drivers/ieee1394/sbp2.h

index 6bd26a91111eed70068ffc76a797e55a4699ba8b..5156b88b0f2a8a615f3188c0f2a440d083bda056 100644 (file)
@@ -462,23 +462,18 @@ static void sbp2util_notify_fetch_agent(struct scsi_id_instance_data *scsi_id,
 
 static void sbp2util_write_orb_pointer(struct work_struct *work)
 {
-       struct scsi_id_instance_data *scsi_id =
-               container_of(work, struct scsi_id_instance_data,
-                            protocol_work.work);
        quadlet_t data[2];
 
-       data[0] = ORB_SET_NODE_ID(scsi_id->hi->host->node_id);
-       data[1] = scsi_id->last_orb_dma;
+       data[0] = ORB_SET_NODE_ID(
+                       (container_of(work, struct scsi_id_instance_data, protocol_work))->hi->host->node_id);
+       data[1] = (container_of(work, struct scsi_id_instance_data, protocol_work))->last_orb_dma;
        sbp2util_cpu_to_be32_buffer(data, 8);
-       sbp2util_notify_fetch_agent(scsi_id, SBP2_ORB_POINTER_OFFSET, data, 8);
+       sbp2util_notify_fetch_agent(container_of(work, struct scsi_id_instance_data, protocol_work), SBP2_ORB_POINTER_OFFSET, data, 8);
 }
 
 static void sbp2util_write_doorbell(struct work_struct *work)
 {
-       struct scsi_id_instance_data *scsi_id =
-               container_of(work, struct scsi_id_instance_data,
-                            protocol_work.work);
-       sbp2util_notify_fetch_agent(scsi_id, SBP2_DOORBELL_OFFSET, NULL, 4);
+       sbp2util_notify_fetch_agent(container_of(work, struct scsi_id_instance_data, protocol_work), SBP2_DOORBELL_OFFSET, NULL, 4);
 }
 
 /*
@@ -795,7 +790,7 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud
        INIT_LIST_HEAD(&scsi_id->scsi_list);
        spin_lock_init(&scsi_id->sbp2_command_orb_lock);
        atomic_set(&scsi_id->state, SBP2LU_STATE_RUNNING);
-       INIT_DELAYED_WORK(&scsi_id->protocol_work, NULL);
+       INIT_WORK(&scsi_id->protocol_work, NULL);
 
        ud->device.driver_data = scsi_id;
 
@@ -1578,7 +1573,7 @@ static int sbp2_agent_reset(struct scsi_id_instance_data *scsi_id, int wait)
        int retval;
        unsigned long flags;
 
-       cancel_delayed_work(&scsi_id->protocol_work);
+       /* cancel_delayed_work(&scsi_id->protocol_work); */
        if (wait)
                flush_scheduled_work();
 
@@ -1889,10 +1884,11 @@ static void sbp2_link_orb_command(struct scsi_id_instance_data *scsi_id,
                 * We do not accept new commands until the job is over.
                 */
                scsi_block_requests(scsi_id->scsi_host);
-               PREPARE_DELAYED_WORK(&scsi_id->protocol_work,
+               PREPARE_WORK(&scsi_id->protocol_work,
                             last_orb ? sbp2util_write_doorbell:
-                                       sbp2util_write_orb_pointer);
-               schedule_delayed_work(&scsi_id->protocol_work, 0);
+                                       sbp2util_write_orb_pointer
+                            /* */);
+               schedule_work(&scsi_id->protocol_work);
        }
 }
 
index 7b4242024665a90f6f3cc59f05798a9dac0be861..5483b458bd77de3c9ba125a28d51ef109585c438 100644 (file)
@@ -342,7 +342,7 @@ struct scsi_id_instance_data {
        unsigned workarounds;
 
        atomic_t state;
-       struct delayed_work protocol_work;
+       struct work_struct protocol_work;
 };
 
 /* For use in scsi_id_instance_data.state */