diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-01-27 10:34:55 +0100 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-09 22:02:49 +0100 |
commit | 641f8791f031d6133e5c3e9ce036b3e942416e9d (patch) | |
tree | f65db59e8cedd09da36a956234a93b73e42aab89 /drivers/firewire/fw-device.c | |
parent | 0edeefd99fd31f74432aba5860f6ebcbde874dbf (diff) | |
download | lwn-641f8791f031d6133e5c3e9ce036b3e942416e9d.tar.gz lwn-641f8791f031d6133e5c3e9ce036b3e942416e9d.zip |
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.c | 6 |
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) * necessary. We have to use the atomic cmpxchg here to avoid * racing with the FW_NODE_DESTROYED case in * fw_node_event(). */ - if (cmpxchg(&device->state, + if (atomic_cmpxchg(&device->state, FW_DEVICE_INITIALIZING, FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN) fw_device_shutdown(&device->work.work); @@ -551,7 +551,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event) * device_for_each_child() in FW_NODE_UPDATED is * doesn't freak out. */ device_initialize(&device->device); - device->state = FW_DEVICE_INITIALIZING; + atomic_set(&device->state, FW_DEVICE_INITIALIZING); device->card = fw_card_get(card); device->node = fw_node_get(node); device->node_id = node->node_id; @@ -596,7 +596,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event) * the device in shutdown state to have that code fail * to create the device. */ device = node->data; - if (xchg(&device->state, + if (atomic_xchg(&device->state, FW_DEVICE_SHUTDOWN) == FW_DEVICE_RUNNING) { INIT_DELAYED_WORK(&device->work, fw_device_shutdown); schedule_delayed_work(&device->work, 0); |