aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-device.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2007-01-27 04:34:55 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-09 16:02:49 -0500
commit641f8791f031d6133e5c3e9ce036b3e942416e9d (patch)
treef65db59e8cedd09da36a956234a93b73e42aab89 /drivers/firewire/fw-device.c
parent0edeefd99fd31f74432aba5860f6ebcbde874dbf (diff)
firewire: use atomic type for fw_device.state
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-device.c')
-rw-r--r--drivers/firewire/fw-device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index 4ea8d4d08a61..85b6f2cfa414 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -494,7 +494,7 @@ static void fw_device_init(struct work_struct *work)
494 * necessary. We have to use the atomic cmpxchg here to avoid 494 * necessary. We have to use the atomic cmpxchg here to avoid
495 * racing with the FW_NODE_DESTROYED case in 495 * racing with the FW_NODE_DESTROYED case in
496 * fw_node_event(). */ 496 * fw_node_event(). */
497 if (cmpxchg(&device->state, 497 if (atomic_cmpxchg(&device->state,
498 FW_DEVICE_INITIALIZING, 498 FW_DEVICE_INITIALIZING,
499 FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN) 499 FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN)
500 fw_device_shutdown(&device->work.work); 500 fw_device_shutdown(&device->work.work);
@@ -551,7 +551,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
551 * device_for_each_child() in FW_NODE_UPDATED is 551 * device_for_each_child() in FW_NODE_UPDATED is
552 * doesn't freak out. */ 552 * doesn't freak out. */
553 device_initialize(&device->device); 553 device_initialize(&device->device);
554 device->state = FW_DEVICE_INITIALIZING; 554 atomic_set(&device->state, FW_DEVICE_INITIALIZING);
555 device->card = fw_card_get(card); 555 device->card = fw_card_get(card);
556 device->node = fw_node_get(node); 556 device->node = fw_node_get(node);
557 device->node_id = node->node_id; 557 device->node_id = node->node_id;
@@ -596,7 +596,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
596 * the device in shutdown state to have that code fail 596 * the device in shutdown state to have that code fail
597 * to create the device. */ 597 * to create the device. */
598 device = node->data; 598 device = node->data;
599 if (xchg(&device->state, 599 if (atomic_xchg(&device->state,
600 FW_DEVICE_SHUTDOWN) == FW_DEVICE_RUNNING) { 600 FW_DEVICE_SHUTDOWN) == FW_DEVICE_RUNNING) {
601 INIT_DELAYED_WORK(&device->work, fw_device_shutdown); 601 INIT_DELAYED_WORK(&device->work, fw_device_shutdown);
602 schedule_delayed_work(&device->work, 0); 602 schedule_delayed_work(&device->work, 0);