Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752976AbbEHLBM (ORCPT ); Fri, 8 May 2015 07:01:12 -0400 Received: from mga02.intel.com ([134.134.136.20]:31887 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752748AbbEHLBI (ORCPT ); Fri, 8 May 2015 07:01:08 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,390,1427785200"; d="scan'208";a="491026369" Message-ID: <1431082863.28073.19.camel@linux.intel.com> Subject: Re: [PATCH v4 1/1] clkdev: change prototype of clk_register_clkdev() From: Andy Shevchenko To: Russell King - ARM Linux Cc: linux-kernel@vger.kernel.org, Stephen Boyd , Mike Turquette , Lee Jones , Bryan Huntsman , Lorenzo Pieralisi , Ralf Baechle , Sylwester Nawrocki , Tomeu Vizoso Date: Fri, 08 May 2015 14:01:03 +0300 In-Reply-To: <20150506125128.GU2067@n2100.arm.linux.org.uk> References: <1430907852-160833-1-git-send-email-andriy.shevchenko@linux.intel.com> <1430907852-160833-2-git-send-email-andriy.shevchenko@linux.intel.com> <20150506110956.GN2067@n2100.arm.linux.org.uk> <1430915649.28073.6.camel@linux.intel.com> <20150506125128.GU2067@n2100.arm.linux.org.uk> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1791 Lines: 43 On Wed, 2015-05-06 at 13:51 +0100, Russell King - ARM Linux wrote: > On Wed, May 06, 2015 at 03:34:09PM +0300, Andy Shevchenko wrote: > > On Wed, 2015-05-06 at 12:09 +0100, Russell King - ARM Linux wrote: > > > On Wed, May 06, 2015 at 01:24:12PM +0300, Andy Shevchenko wrote: > > > > Since clk_register_clkdev() is exported for modules the caller should get a > > > > pointer to the allocated resources. Otherwise the memory leak is guaranteed on > > > > the ->remove() stage. > > > > > > clk_register_clkdev() is there to assist mass clock registrations, which > > > typically happen in platform code. It's there to simplify the "I need > > > to register this clock which I'm not going to release again". > > > > > > I don't see any of these locations trying to unregister their clk from > > > clkdev, so I doubt this patch is needed. > > > > We are doing the driver which will use this (as I mentioned in the cover > > letter). > > > > > > > > Where a module wants to remove its clk from clkdev, it should register > > > its clk with clkdev_create() and remove it with clkdev_drop(). > > > > > > > You are talking about something in the wild? I can't find > > clkdev_create() neither in current clk.git nor in linux-next.git. > > It'll be in linux-next RSN. > > Search lakml for "Fix fallout from per-user struct clk patches" > Thanks, we will use it, though the documentation might say that there is a risk of memory leak in case of usage clk_register_clkdev(). -- Andy Shevchenko Intel Finland Oy -- 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/