diff options
author | Thierry Reding <thierry.reding@gmail.com> | 2023-04-13 14:25:48 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2023-04-14 11:35:52 +0200 |
commit | 247ee6c780406513c6031a7f4ea41f1648b03295 (patch) | |
tree | 2d0e9684ed4e687b118e149ca42bcfb6792e174f /drivers/pwm | |
parent | 0af4d704ba8e5ee632b6e65015ffe4d229c1a9a9 (diff) |
pwm: Remove unused radix tree
The radix tree's only use was to map PWM channels to the global number
space. With that number space gone, the radix tree is now unused, so it
can simply be removed.
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r-- | drivers/pwm/core.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 9ce85c6157e4..3dacceaef4a9 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -28,12 +28,11 @@ static DEFINE_MUTEX(pwm_lookup_lock); static LIST_HEAD(pwm_lookup_list); -/* protects access to pwm_chips, allocated_pwms, and pwm_tree */ +/* protects access to pwm_chips and allocated_pwms */ static DEFINE_MUTEX(pwm_lock); static LIST_HEAD(pwm_chips); static DECLARE_BITMAP(allocated_pwms, MAX_PWMS); -static RADIX_TREE(pwm_tree, GFP_KERNEL); /* Called with pwm_lock held */ static int alloc_pwms(unsigned int count) @@ -54,14 +53,6 @@ static int alloc_pwms(unsigned int count) /* Called with pwm_lock held */ static void free_pwms(struct pwm_chip *chip) { - unsigned int i; - - for (i = 0; i < chip->npwm; i++) { - struct pwm_device *pwm = &chip->pwms[i]; - - radix_tree_delete(&pwm_tree, pwm->pwm); - } - bitmap_clear(allocated_pwms, chip->base, chip->npwm); kfree(chip->pwms); @@ -302,8 +293,6 @@ int pwmchip_add(struct pwm_chip *chip) pwm->chip = chip; pwm->pwm = chip->base + i; pwm->hwpwm = i; - - radix_tree_insert(&pwm_tree, pwm->pwm, pwm); } list_add(&chip->list, &pwm_chips); |