From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Brown Subject: Re: [PATCH] mfd: convert devicetree to platform data on max8925 Date: Sun, 10 Jul 2011 18:17:31 +0900 Message-ID: <20110710091729.GA23521@opensource.wolfsonmicro.com> References: <1310120428-22700-2-git-send-email-haojian.zhuang@marvell.com> <1310120428-22700-3-git-send-email-haojian.zhuang@marvell.com> <1310120428-22700-4-git-send-email-haojian.zhuang@marvell.com> <1310120428-22700-5-git-send-email-haojian.zhuang@marvell.com> <1310120428-22700-6-git-send-email-haojian.zhuang@marvell.com> <1310120428-22700-7-git-send-email-haojian.zhuang@marvell.com> <1310120428-22700-8-git-send-email-haojian.zhuang@marvell.com> <1310120428-22700-9-git-send-email-haojian.zhuang@marvell.com> <1310120428-22700-10-git-send-email-haojian.zhuang@marvell.com> <20110710072027.GE10912@ponder.secretlab.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20110710072027.GE10912-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@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: Grant Likely Cc: eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Haojian Zhuang , samuel.ortiz-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, alan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org List-Id: devicetree@vger.kernel.org On Sun, Jul 10, 2011 at 04:20:27PM +0900, Grant Likely wrote: > On Fri, Jul 08, 2011 at 06:20:26PM +0800, Haojian Zhuang wrote: > > + if (pdata == NULL) > > + return NULL; > > + pdata->regulator[0] = kzalloc(sizeof(struct regulator_init_data) > > + * MAX8925_MAX_REGULATOR, GFP_KERNEL); > ditto. > Is it appropriate to allocated the entire table of regulators? From > the parse_regulator function above, it looks like only one of the > regulators will actually get registered (I've not dug deeply into what > the driver needs here though). If the code/binding doesn't allow the use of all the regulators on the device the code is probably wrong, it'd be very unusual to have hardware like that.