From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [PATCH 2/9] regulator: helper routine to extract regulator_init_data Date: Thu, 29 Sep 2011 19:24:08 -0600 Message-ID: <20110930012408.GE12606@ponder.secretlab.ca> References: <1317118372-17052-1-git-send-email-rnayak@ti.com> <1317118372-17052-3-git-send-email-rnayak@ti.com> <20110927121003.GB4289@opensource.wolfsonmicro.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20110927121003.GB4289-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Mark Brown Cc: patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lrg-l0cyMroinI0@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Tue, Sep 27, 2011 at 01:10:04PM +0100, Mark Brown wrote: > On Tue, Sep 27, 2011 at 03:42:45PM +0530, Rajendra Nayak wrote: > > > + init_data = devm_kzalloc(dev, sizeof(struct regulator_init_data), > > + GFP_KERNEL); > > + if (!init_data) > > + return NULL; /* Out of memory? */ > > This means that the init data will be kept around for the entire > lifetime of the device rather than being discarded. > > > + init_data->supply_regulator = (char *)of_get_property(dev->of_node, > > + "regulator-supplies", NULL); > > I'd expect that in the device tree world the supply regulator would > reference the node for that regulator. Yes, I would expect the same. From mboxrd@z Thu Jan 1 00:00:00 1970 From: grant.likely@secretlab.ca (Grant Likely) Date: Thu, 29 Sep 2011 19:24:08 -0600 Subject: [PATCH 2/9] regulator: helper routine to extract regulator_init_data In-Reply-To: <20110927121003.GB4289@opensource.wolfsonmicro.com> References: <1317118372-17052-1-git-send-email-rnayak@ti.com> <1317118372-17052-3-git-send-email-rnayak@ti.com> <20110927121003.GB4289@opensource.wolfsonmicro.com> Message-ID: <20110930012408.GE12606@ponder.secretlab.ca> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, Sep 27, 2011 at 01:10:04PM +0100, Mark Brown wrote: > On Tue, Sep 27, 2011 at 03:42:45PM +0530, Rajendra Nayak wrote: > > > + init_data = devm_kzalloc(dev, sizeof(struct regulator_init_data), > > + GFP_KERNEL); > > + if (!init_data) > > + return NULL; /* Out of memory? */ > > This means that the init data will be kept around for the entire > lifetime of the device rather than being discarded. > > > + init_data->supply_regulator = (char *)of_get_property(dev->of_node, > > + "regulator-supplies", NULL); > > I'd expect that in the device tree world the supply regulator would > reference the node for that regulator. Yes, I would expect the same.