lkml.org 
[lkml]   [2012]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] [PATCH] extcon: driver model release call not needed
From
Date
On Sat, 2012-10-20 at 10:57 +0900, Chanwoo Choi wrote:
> On 10/19/2012 02:12 AM, anish kumar wrote:
> > From: anish kumar <anish198519851985@gmail.com>
> >
> > We don't need a release call in this file as we are doing
> > everything needed in unregister call and we don't have any
> > more pointer to free up.
> >
> > Signed-off-by: anish kumar <anish198519851985@gmail.com>
> > ---
> > drivers/extcon/extcon-class.c | 4 +---
> > 1 files changed, 1 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c
> > index 946a318..cf30eb1 100644
> > --- a/drivers/extcon/extcon-class.c
> > +++ b/drivers/extcon/extcon-class.c
> > @@ -585,9 +585,7 @@ static void extcon_cleanup(struct extcon_dev *edev, bool skip)
> >
> > static void extcon_dev_release(struct device *dev)
> > {
> > - struct extcon_dev *edev = (struct extcon_dev *) dev_get_drvdata(dev);
> > -
> > - extcon_cleanup(edev, true);
> > + /* We don't have any thing to free here */
> > }
> >
> > static const char *muex_name = "mutually_exclusive";
>
> I can't agree this patch. The extcon_dev_release() function is used
> for dev->release. If some case without calling extcon_dev_unregister(),
> I think dev->release function is needed to free memory of edev->dev.
Is it not being released by extcon_dev_unregister?
I think it is released by that and we will do two times free and
list_del(&edev->entry) as it is called by extcon_dev_release also.
>
> The edev->dev->release store the function pointer of extcon_dev_release()
> in extcon_dev_register().
> edev->dev->parent = dev;
> edev->dev->class = extcon_class;
> edev->dev->release = extcon_dev_release;
>
>
> Thanks,
> Chanwoo Choi




\
 
 \ /
  Last update: 2012-10-20 05:01    [W:0.076 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site