* this radix tree
* @pin_group_xa: optionally each pin group can be stored in this array
* @num_groups: optionally number of groups can be kept here
- * @pin_function_tree: optionally each function can be stored in this radix tree
+ * @pin_function_xa: optionally each function can be stored in this array
* @num_functions: optionally number of functions can be kept here
* @gpio_ranges: a list of GPIO ranges that is handled by this pin controller,
* ranges are added to this list at runtime
unsigned int num_groups;
#endif
#ifdef CONFIG_GENERIC_PINMUX_FUNCTIONS
- struct radix_tree_root pin_function_tree;
+ struct xarray pin_function_xa;
unsigned int num_functions;
#endif
struct list_head gpio_ranges;
{
struct function_desc *function;
- function = radix_tree_lookup(&pctldev->pin_function_tree,
- selector);
+ function = xa_load(&pctldev->pin_function_xa, selector);
if (!function)
return NULL;
{
struct function_desc *function;
- function = radix_tree_lookup(&pctldev->pin_function_tree,
- selector);
+ function = xa_load(&pctldev->pin_function_xa, selector);
if (!function) {
dev_err(pctldev->dev, "%s could not find function%i\n",
__func__, selector);
{
struct function_desc *function;
- function = radix_tree_lookup(&pctldev->pin_function_tree,
- selector);
+ function = xa_load(&pctldev->pin_function_xa, selector);
if (!function)
return NULL;
function->num_group_names = num_groups;
function->data = data;
- radix_tree_insert(&pctldev->pin_function_tree, selector, function);
+ xa_store(&pctldev->pin_function_xa, selector, function, GFP_KERNEL);
pctldev->num_functions++;
{
struct function_desc *function;
- function = radix_tree_lookup(&pctldev->pin_function_tree,
- selector);
+ function = xa_erase(&pctldev->pin_function_xa, selector);
if (!function)
return -ENOENT;
- radix_tree_delete(&pctldev->pin_function_tree, selector);
devm_kfree(pctldev->dev, function);
pctldev->num_functions--;
*/
void pinmux_generic_free_functions(struct pinctrl_dev *pctldev)
{
- struct radix_tree_iter iter;
- void __rcu **slot;
-
- radix_tree_for_each_slot(slot, &pctldev->pin_function_tree, &iter, 0)
- radix_tree_delete(&pctldev->pin_function_tree, iter.index);
-
+ xa_destroy(&pctldev->pin_function_xa);
pctldev->num_functions = 0;
}