Re: [PATCH] Try 2, Fix release function in IPMI device model

From: Dmitry Torokhov
Date: Wed Mar 22 2006 - 16:20:24 EST


On 3/22/06, Corey Minyard <minyard@xxxxxxx> wrote:
>
> struct bmc_device
> {
> - struct platform_device dev;
> + struct platform_device *dev;
> struct ipmi_device_id id;
> unsigned char guid[16];
> int guid_set;
> - int interfaces;
> +
> + struct kref refcount;
>

Hi,

I am confused as to why you need kref here. Just unregister/kfree
memory occupied by your device structure after doing
platform_device_unregister and that's it. platform code won't
reference your memory and your attribute code should not be called
from module exit code so everything shoudl be fine.

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