Re: [2.5.58][PnP] Some small points.

From: Ruslan U. Zakirov (cubic@miee.ru)
Date: Fri Jan 17 2003 - 12:16:54 EST


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/



This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:16 EST