You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
firewire: clean up fw_card reference counting
This is a functionally equivalent replacement of the current reference counting of struct fw_card instances. It only converts it to common idioms as suggested by Kristian Høgsberg: - struct kref replaces atomic_t as the counter. - wait_for_completion is used to wait for all card users to complete. BTW, it may make sense to count card->flush_timer and card->work as card users too. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This commit is contained in:
@@ -168,7 +168,7 @@ static void fw_device_release(struct device *dev)
|
||||
fw_node_put(device->node);
|
||||
kfree(device->config_rom);
|
||||
kfree(device);
|
||||
atomic_dec(&card->device_count);
|
||||
fw_card_put(card);
|
||||
}
|
||||
|
||||
int fw_device_enable_phys_dma(struct fw_device *device)
|
||||
@@ -946,8 +946,7 @@ void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
|
||||
*/
|
||||
device_initialize(&device->device);
|
||||
atomic_set(&device->state, FW_DEVICE_INITIALIZING);
|
||||
atomic_inc(&card->device_count);
|
||||
device->card = card;
|
||||
device->card = fw_card_get(card);
|
||||
device->node = fw_node_get(node);
|
||||
device->node_id = node->node_id;
|
||||
device->generation = card->generation;
|
||||
|
||||
Reference in New Issue
Block a user