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

From: Corey Minyard
Date: Wed Mar 22 2006 - 16:25:06 EST


Dmitry Torokhov wrote:

>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.
>
>
This structure represents a "BMC", which is a microcontroller
that does managment functions. There may be more than one
interface to a BMC, so the kref keeps track of all the interfaces
referencing the structure.

-Corey
-
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/