public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: "G, Manjunath Kondaiah" <manjugk@ti.com>
To: "DebBarma, Tarun Kanti" <tarun.kanti@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"Gopinath, Thara" <thara@ti.com>
Subject: Re: [PATCH v5 9/12] OMAP: dmtimer: platform driver
Date: Tue, 7 Dec 2010 11:17:42 +0530	[thread overview]
Message-ID: <20101207054742.GA29773@GLPP-machine> (raw)
In-Reply-To: <5A47E75E594F054BAF48C5E4FC4B92AB03736F506A@dbde02.ent.ti.com>

* DebBarma, Tarun Kanti <tarun.kanti@ti.com> [2010-12-07 11:02:26 +0530]:

> > -----Original Message-----
> > From: G, Manjunath Kondaiah
> > Sent: Tuesday, December 07, 2010 12:40 AM
> > To: DebBarma, Tarun Kanti
> > Cc: linux-omap@vger.kernel.org; Gopinath, Thara
> > Subject: Re: [PATCH v5 9/12] OMAP: dmtimer: platform driver
> > 
> > On Tue, Dec 07, 2010 at 05:14:16AM +0530, Tarun Kanti DebBarma wrote:
> > > From: Thara Gopinath <thara@ti.com>
> > >
> > > Add dmtimer platform driver functions which include:
> > > (1) platform driver initialization
> > > (2) driver probe function
> > > (3) driver remove function
> > >
> > > Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
> > > Signed-off-by: Thara Gopinath <thara@ti.com>
> > > Reviewed-by: Cousson, Benoit <b-cousson@ti.com>

[...]

> > > +
> > > +err_free_mem:
> > > +	kfree(timer);
> > > +
> > > +err_release_ioregion:
> > > +	release_mem_region(mem->start, resource_size(mem));
> > > +
> > > +err_free_pdev:
> > You can also free pdata?
> This pdata points to data within pdev created by omap_device_build.
> But the pdata which was allocated locally is already freed
> After omap_device_build() in omap_timer_init() in mach-omap.

You should also free memory allocated for pdata during omap_device_build
since you no longer require pdata due to probe fail.

> 
> > > +	platform_device_del(pdev);
> > > +
> > > +	return ret;
> > > +}
> > > +
> > > +/**
> > > + * omap_dm_timer_remove - cleanup a registered timer device
> > > + * @pdev:	pointer to current timer platform device
> > > + *
> > > + * Called by driver framework whenever a timer device is unregistered.
> > > + * In addition to freeing platform resources it also deletes the timer
> > > + * entry from the local list.
> > > + */
> > > +static int __devexit omap_dm_timer_remove(struct platform_device *pdev)
> > > +{
> > > +	struct omap_dm_timer *timer, *tmp;
> > > +	unsigned long flags;
> > > +	int ret = -EINVAL;
> > > +
> > > +	spin_lock_irqsave(&dm_timer_lock, flags);
> > > +	list_for_each_entry_safe(timer, tmp, &omap_timer_list, node) {
> > > +		if (timer->pdev->id == pdev->id) {
> > > +			platform_device_del(timer->pdev);
> > > +			list_del(&timer->node);
> > > +			kfree(timer);
> > kfree(pdev->dev.platform_data);
> Ok, this is supposed to be done as part of platform_device_del above.

No. platform_device_del will not free platform_data. You have use kfree for
freeing pdata or platform_data.

-Manjunath

  reply	other threads:[~2010-12-07  5:47 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06 23:44 [PATCH v5 0/12] dmtimer adaptation to platform_driver Tarun Kanti DebBarma
2010-12-06 16:28 ` G, Manjunath Kondaiah
2010-12-07  4:59   ` DebBarma, Tarun Kanti
2010-12-14  2:09     ` Kevin Hilman
2010-12-06 23:44 ` [PATCH v5 1/12] OMAP2+: dmtimer: add device names to flck nodes Tarun Kanti DebBarma
2010-12-06 23:44 ` [PATCH v5 2/12] OMAP2420: hwmod data: add dmtimer Tarun Kanti DebBarma
2010-12-06 16:57   ` G, Manjunath Kondaiah
2010-12-06 23:44 ` [PATCH v5 3/12] OMAP2430: " Tarun Kanti DebBarma
2010-12-06 23:44 ` [PATCH v5 4/12] OMAP3: " Tarun Kanti DebBarma
2010-12-06 23:44 ` [PATCH v5 5/12] OMAP4: " Tarun Kanti DebBarma
2010-12-06 23:44 ` [PATCH v5 6/12] OMAP: dmtimer: infrastructure to support hwmod Tarun Kanti DebBarma
2010-12-06 17:09   ` G, Manjunath Kondaiah
2010-12-07  4:50     ` DebBarma, Tarun Kanti
2010-12-06 23:44 ` [PATCH v5 7/12] OMAP1: dmtimer: conversion to platform devices Tarun Kanti DebBarma
2010-12-06 17:56   ` G, Manjunath Kondaiah
2010-12-07  5:17     ` DebBarma, Tarun Kanti
2010-12-06 23:44 ` [PATCH v5 8/12] OMAP2+: dmtimer: convert " Tarun Kanti DebBarma
2010-12-06 18:26   ` G, Manjunath Kondaiah
2010-12-07  5:21     ` DebBarma, Tarun Kanti
2010-12-07  5:46   ` Varadarajan, Charulatha
2010-12-07  5:50     ` DebBarma, Tarun Kanti
2010-12-06 23:44 ` [PATCH v5 9/12] OMAP: dmtimer: platform driver Tarun Kanti DebBarma
2010-12-06 19:10   ` G, Manjunath Kondaiah
2010-12-07  5:32     ` DebBarma, Tarun Kanti
2010-12-07  5:47       ` G, Manjunath Kondaiah [this message]
2010-12-07  6:14         ` DebBarma, Tarun Kanti
2010-12-06 23:44 ` [PATCH v5 10/12] OMAP: dmtimer: switch-over to platform device driver Tarun Kanti DebBarma
2010-12-07  5:27   ` Varadarajan, Charulatha
2010-12-07  5:49     ` DebBarma, Tarun Kanti
2010-12-13 15:07   ` Cousson, Benoit
2010-12-06 23:44 ` [PATCH v5 11/12] OMAP: dmtimer: pm_runtime support Tarun Kanti DebBarma
2010-12-06 23:44 ` [PATCH v5 12/12] OMAP: dmtimer: add timeout to low-level routines Tarun Kanti DebBarma
2010-12-14  6:45 ` [PATCH v5 0/12] dmtimer adaptation to platform_driver Paul Walmsley
2010-12-15  2:06 ` Kevin Hilman
2010-12-15  4:59   ` DebBarma, Tarun Kanti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101207054742.GA29773@GLPP-machine \
    --to=manjugk@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tarun.kanti@ti.com \
    --cc=thara@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox