Re: [PATCH 06/24] thunderbolt: Introduce thunderbolt bus and connection manager

From: Andy Shevchenko
Date: Fri May 19 2017 - 09:17:09 EST


On Fri, May 19, 2017 at 11:15 AM, Mika Westerberg
<mika.westerberg@xxxxxxxxxxxxxxx> wrote:
> On Thu, May 18, 2017 at 07:43:13PM +0300, Andy Shevchenko wrote:
>> On Thu, May 18, 2017 at 5:38 PM, Mika Westerberg
>> <mika.westerberg@xxxxxxxxxxxxxxx> wrote:

>> One nit below.
>>
>> > +static void tb_domain_release(struct device *dev)
>> > +{
>> > + struct tb *tb = container_of(dev, struct tb, dev);
>> > +
>> > + if (tb->ctl)
>> > + tb_ctl_free(tb->ctl);
>>
>> The usual pattern is to put such checks inside *_free() type of functions.
>
> tb_ctl_free() and these patterns are from the original code. I just
> moved the calls from tb.c intto here. No problem doing that change but I
> suppose that should be done first in a separate patch before this patch.

Precisely!

>> > +
>> > + destroy_workqueue(tb->wq);
>> > + ida_simple_remove(&tb_domain_ida, tb->index);
>> > + kfree(tb);
>> > +}

--
With Best Regards,
Andy Shevchenko