Skip to content

Commit 247ee6c

Browse files
committed
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>
1 parent 0af4d70 commit 247ee6c

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

drivers/pwm/core.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@
2828
static DEFINE_MUTEX(pwm_lookup_lock);
2929
static LIST_HEAD(pwm_lookup_list);
3030

31-
/* protects access to pwm_chips, allocated_pwms, and pwm_tree */
31+
/* protects access to pwm_chips and allocated_pwms */
3232
static DEFINE_MUTEX(pwm_lock);
3333

3434
static LIST_HEAD(pwm_chips);
3535
static DECLARE_BITMAP(allocated_pwms, MAX_PWMS);
36-
static RADIX_TREE(pwm_tree, GFP_KERNEL);
3736

3837
/* Called with pwm_lock held */
3938
static int alloc_pwms(unsigned int count)
@@ -54,14 +53,6 @@ static int alloc_pwms(unsigned int count)
5453
/* Called with pwm_lock held */
5554
static void free_pwms(struct pwm_chip *chip)
5655
{
57-
unsigned int i;
58-
59-
for (i = 0; i < chip->npwm; i++) {
60-
struct pwm_device *pwm = &chip->pwms[i];
61-
62-
radix_tree_delete(&pwm_tree, pwm->pwm);
63-
}
64-
6556
bitmap_clear(allocated_pwms, chip->base, chip->npwm);
6657

6758
kfree(chip->pwms);
@@ -302,8 +293,6 @@ int pwmchip_add(struct pwm_chip *chip)
302293
pwm->chip = chip;
303294
pwm->pwm = chip->base + i;
304295
pwm->hwpwm = i;
305-
306-
radix_tree_insert(&pwm_tree, pwm->pwm, pwm);
307296
}
308297

309298
list_add(&chip->list, &pwm_chips);

0 commit comments

Comments
 (0)