From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751607AbcGMMst (ORCPT ); Wed, 13 Jul 2016 08:48:49 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:38167 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750959AbcGMMsk (ORCPT ); Wed, 13 Jul 2016 08:48:40 -0400 Date: Wed, 13 Jul 2016 13:49:35 +0100 From: Lee Jones To: Harald Geyer Cc: Ksenija =?utf-8?Q?Stanojevi=C4=87?= , linux-kernel@vger.kernel.org, Dmitry Torokhov , linux-input@vger.kernel.org, Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Marek =?utf-8?B?VmHFoXV0?= , linux-iio@vger.kernel.org, Stefan Wahren , Fabio Estevam Subject: Re: [PATCH v3 1/4] mfd: mxs-lradc: Add support for mxs-lradc MFD Message-ID: <20160713124935.GC11154@dell> References: <370a02584386944b465deff5ccc48c8919b23dba.1466769907.git.ksenija.stanojevic@gmail.com> <20160628162834.GF29166@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 01 Jul 2016, Harald Geyer wrote: > Hi Ksenija! > > Ksenija Stanojević writes: > > On Tue, Jun 28, 2016 at 6:28 PM, Lee Jones wrote: > > >> +static int mxs_lradc_add_device(struct platform_device *pdev, > > >> + struct mxs_lradc *lradc, char *name, int i) > > >> +{ > > >> + struct mfd_cell *cell; > > >> + > > >> + cell = &lradc->cells[i]; > > >> + cell->name = name; > > >> + cell->platform_data = lradc; > > >> + cell->pdata_size = sizeof(*lradc); > > >> + > > >> + return devm_mfd_add_devices(&pdev->dev, -1, cell, 1, NULL, 0, NULL); > > >> +} > > > > > > Please don't roll your own API. > > > > > > Use 'struct mfd_cell' like everyone else does. > > > > It has been suggested in previous reviews to use separate function to > > register mfd device, and to make mfd_cell allocate dynamically because > > struc mxs-lradc is allocated dynamically. > > But I can revrse changes and make mfd_cells allocate staticaly > > wthout separate function. > > I think making mfd_cells members of struct mxs-lradc will address all > review comments. No, please don't do that either. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog