diff options
-rw-r--r-- | drivers/firewire/fw-card.c | 4 | ||||
-rw-r--r-- | drivers/firewire/fw-device.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c index f785b1005284..3f8661a52acc 100644 --- a/drivers/firewire/fw-card.c +++ b/drivers/firewire/fw-card.c | |||
@@ -367,9 +367,9 @@ void | |||
367 | fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver, | 367 | fw_card_initialize(struct fw_card *card, const struct fw_card_driver *driver, |
368 | struct device *device) | 368 | struct device *device) |
369 | { | 369 | { |
370 | static int index; | 370 | static atomic_t index = ATOMIC_INIT(-1); |
371 | 371 | ||
372 | card->index = index++; | 372 | card->index = atomic_inc_return(&index); |
373 | card->driver = driver; | 373 | card->driver = driver; |
374 | card->device = device; | 374 | card->device = device; |
375 | card->current_tlabel = 0; | 375 | card->current_tlabel = 0; |
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) | |||
434 | 434 | ||
435 | static void fw_device_init(struct work_struct *work) | 435 | static void fw_device_init(struct work_struct *work) |
436 | { | 436 | { |
437 | static int serial; | 437 | static atomic_t serial = ATOMIC_INIT(-1); |
438 | struct fw_device *device = | 438 | struct fw_device *device = |
439 | container_of(work, struct fw_device, work.work); | 439 | container_of(work, struct fw_device, work.work); |
440 | 440 | ||
@@ -460,7 +460,7 @@ static void fw_device_init(struct work_struct *work) | |||
460 | device->device.release = fw_device_release; | 460 | device->device.release = fw_device_release; |
461 | device->device.parent = device->card->device; | 461 | device->device.parent = device->card->device; |
462 | snprintf(device->device.bus_id, sizeof device->device.bus_id, | 462 | snprintf(device->device.bus_id, sizeof device->device.bus_id, |
463 | "fw%d", serial++); | 463 | "fw%d", atomic_inc_return(&serial)); |
464 | 464 | ||
465 | if (alloc_chrdev_region(&device->device.devt, 0, 1, "fw")) { | 465 | if (alloc_chrdev_region(&device->device.devt, 0, 1, "fw")) { |
466 | fw_error("Failed to register char device region.\n"); | 466 | fw_error("Failed to register char device region.\n"); |