// SPDX-License-Identifier: GPL-2.0+ /* Microchip Sparx5 Switch driver * * Copyright (c) 2023 Microchip Technology Inc. and its subsidiaries. */ #include "sparx5_main_regs.h" #include "sparx5_main.h" static u32 sparx5_pool_id_to_idx(u32 id) { … } u32 sparx5_pool_idx_to_id(u32 idx) { … } /* Release resource from pool. * Return reference count on success, otherwise return error. */ int sparx5_pool_put(struct sparx5_pool_entry *pool, int size, u32 id) { … } /* Get resource from pool. * Return reference count on success, otherwise return error. */ int sparx5_pool_get(struct sparx5_pool_entry *pool, int size, u32 *id) { … } /* Get resource from pool that matches index. * Return reference count on success, otherwise return error. */ int sparx5_pool_get_with_idx(struct sparx5_pool_entry *pool, int size, u32 idx, u32 *id) { … }