summaryrefslogtreecommitdiff
path: root/drivers/firewire/core.h
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2024-08-12 10:42:50 +0900
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>2024-08-12 10:42:50 +0900
commit7e5a7725a0e4030cf37f8b93ff9d4328166a3b85 (patch)
tree441fb4886f85bbcc5b1b53bea89d16c20db572ed /drivers/firewire/core.h
parentebb9d3ca8f7efc1b6a2f1750d1058eda444883d0 (diff)
firewire: core: replace IDR with XArray to maintain fw_device
In core function, the instances of fw_device corresponding to firewire device node in system are maintained by IDR. As of kernel v6.0, IDR has been superseded by XArray and deprecated. This commit replaces the usage of IDR with XArray to maintain the device instances. The instance of XArray is allocated statically, and initialized with XA_FLAGS_ALLOC so that the index of allocated entry starts with zero and available as the minor identifier of device node. Link: https://lore.kernel.org/r/20240812014251.165492-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Diffstat (limited to 'drivers/firewire/core.h')
-rw-r--r--drivers/firewire/core.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h
index 189e15e6ba82..8cace026090c 100644
--- a/drivers/firewire/core.h
+++ b/drivers/firewire/core.h
@@ -8,6 +8,7 @@
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/idr.h>
+#include <linux/xarray.h>
#include <linux/mm_types.h>
#include <linux/rwsem.h>
#include <linux/slab.h>
@@ -133,7 +134,7 @@ void fw_cdev_handle_phy_packet(struct fw_card *card, struct fw_packet *p);
/* -device */
extern struct rw_semaphore fw_device_rwsem;
-extern struct idr fw_device_idr;
+extern struct xarray fw_device_xa;
extern int fw_cdev_major;
static inline struct fw_device *fw_device_get(struct fw_device *device)