Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753978Ab3EZOrK (ORCPT ); Sun, 26 May 2013 10:47:10 -0400 Received: from mail-la0-f43.google.com ([209.85.215.43]:54559 "EHLO mail-la0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753851Ab3EZOrI (ORCPT ); Sun, 26 May 2013 10:47:08 -0400 Message-ID: <51A22068.6000605@cogentembedded.com> Date: Sun, 26 May 2013 18:47:04 +0400 From: Sergei Shtylyov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Prabhakar Lad CC: Hans Verkuil , Mauro Carvalho Chehab , LMML , Laurent Pinchart , DLOS , LKML Subject: Re: [PATCH v3 4/9] media: davinci: vpif_capture: move the freeing of irq and global variables to remove() References: <1369569612-30915-1-git-send-email-prabhakar.csengg@gmail.com> <1369569612-30915-5-git-send-email-prabhakar.csengg@gmail.com> In-Reply-To: <1369569612-30915-5-git-send-email-prabhakar.csengg@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1476 Lines: 42 Hello. On 26-05-2013 16:00, Prabhakar Lad wrote: > From: Lad, Prabhakar > Ideally the freeing of irq's and the global variables needs to be > done in the remove() rather than module_exit(), this patch moves > the freeing up of irq's and freeing the memory allocated to channel > objects to remove() callback of struct platform_driver. > Signed-off-by: Lad, Prabhakar > --- > drivers/media/platform/davinci/vpif_capture.c | 31 ++++++++++-------------- > 1 files changed, 13 insertions(+), 18 deletions(-) > diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c > index caaf4fe..f8b7304 100644 > --- a/drivers/media/platform/davinci/vpif_capture.c > +++ b/drivers/media/platform/davinci/vpif_capture.c > @@ -2225,17 +2225,29 @@ vpif_int_err: > */ > static int vpif_remove(struct platform_device *device) > { > - int i; > + struct platform_device *pdev; > struct channel_obj *ch; > + struct resource *res; > + int irq_num, i = 0; > + > + pdev = container_of(vpif_dev, struct platform_device, dev); Why you need this if you should be already called with the correct platform device? WBR, Sergei -- 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/