lkml.org 
[lkml]   [2011]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/2] drivers: create a pinmux subsystem v3
From
Hi Joe,

thanks for the review, excellent as always.

I fixed all except the below pattern, also searched the source to make sure
there were no other cases of the same errors.

On Mon, Jun 13, 2011 at 8:11 PM, Joe Perches <joe@perches.com> wrote:

>> +int pinctrl_register_pins_dense(struct pinctrl_pin_desc const *pins,
>> +                              unsigned num_descs, unsigned num_pins)
>> +{
>> +     int ret;
>> +     unsigned i;
>> +
>> +     ret = pinctrl_register_pins(pins, num_descs, num_pins);
>> +     if (ret) {
>> +             for (i = 0; i < num_pins; i++) {
>> +                     struct pin_desc *pindesc;
>> +
>> +                     spin_lock(&pin_desc_tree_lock);
>> +                     pindesc = radix_tree_lookup(&pin_desc_tree, i);
>> +                     if (pindesc != NULL) {
>> +                             radix_tree_delete(&pin_desc_tree, i);
>> +                             num_pins --;
>> +                     }
>> +                     spin_unlock(&pin_desc_tree_lock);
>> +                     kfree(pindesc);
>> +             }
>
> Second use of this pattern.  Maybe use pinctrl_free_pindescs?

It is quite different actually - in the second case here. we loop over a list
with holes, and we pick each one pin. We cannot loop over the entire
pin range because in this case we don't know the size of the range.

Thanks,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-06-14 11:21    [from the cache]
©2003-2011 Jasper Spaans