lkml.org 
[lkml]   [2003]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [2.5.58][PnP] Some small points.
On Fri, 17 Jan 2003, Adam Belay wrote:
> Hi Ruslan,
> > 3) Queston: Why we do free in this way?
> > static int snd_opl3sa2_free(opl3sa2_t *chip)
> > {
> > #ifdef CONFIG_PNP
> > chip->dev = NULL; -> Here. Why NULL? Who realy free resources and how?
>
> The structure that chip->dev points to is freed by the pnp layer on the release call.
> Is this what you were asking or are you talking about something else?

I've got understood it already. Thanks.
At the begining I think that It's an driver job to free it, I've forgot
that this pnp_devs registered in several lists of PnP layer.

>
> > #endif
> > #ifdef CONFIG_PM
> > if (chip->pm_dev)
> > pm_unregister(chip->pm_dev);
> > #endif
> > if (chip->irq >= 0)
> > free_irq(chip->irq, (void *)chip);
> > if (chip->res_port) {
> > release_resource(chip->res_port);
> > kfree_nocheck(chip->res_port);
> > }
> > snd_magic_kfree(chip);
> > return 0;
> > }

-
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: 2005-03-22 13:32    [W:0.051 / U:1.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site