diff options
author | Kristian Høgsberg <krh@redhat.com> | 2007-02-06 20:49:38 +0100 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-09 22:02:54 +0100 |
commit | bbf19db37e8be3fa6d6fe3e26e50da068b44a0e8 (patch) | |
tree | d324cb9e52aeea485ce1c6293c51800bb4e4deeb /drivers/firewire/fw-device.c | |
parent | firewire: Spell out fw as firewire in sysfs. (diff) | |
download | linux-bbf19db37e8be3fa6d6fe3e26e50da068b44a0e8.tar.xz linux-bbf19db37e8be3fa6d6fe3e26e50da068b44a0e8.zip |
firewire: Use atomic_t's for serial numbers.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Use atomic_inc_return.
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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c index db7556c48760..df2e9296ad5b 100644 --- a/drivers/firewire/fw-device.c +++ b/drivers/firewire/fw-device.c @@ -434,7 +434,7 @@ static void fw_device_shutdown(struct work_struct *work) static void fw_device_init(struct work_struct *work) { - static int serial; + static atomic_t serial = ATOMIC_INIT(-1); struct fw_device *device = container_of(work, struct fw_device, work.work); @@ -460,7 +460,7 @@ static void fw_device_init(struct work_struct *work) device->device.release = fw_device_release; device->device.parent = device->card->device; snprintf(device->device.bus_id, sizeof device->device.bus_id, - "fw%d", serial++); + "fw%d", atomic_inc_return(&serial)); if (alloc_chrdev_region(&device->device.devt, 0, 1, "fw")) { fw_error("Failed to register char device region.\n"); |