From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932277AbbE1O2r (ORCPT ); Thu, 28 May 2015 10:28:47 -0400 Received: from bhuna.collabora.co.uk ([93.93.135.160]:35338 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753518AbbE1O2h (ORCPT ); Thu, 28 May 2015 10:28:37 -0400 Message-ID: <5567260D.6000301@collabora.co.uk> Date: Thu, 28 May 2015 16:28:29 +0200 From: Javier Martinez Canillas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: Lee Jones CC: Samuel Ortiz , Olof Johansson , Doug Anderson , Bill Richardson , Simon Glass , Gwendal Grignou , Stephen Barber , Filipe Brandenburger , Todd Broch , Alexandru M Stan , Heiko Stuebner , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Gwendal Grignou Subject: Re: [PATCH v3 6/7] mfd: cros_ec: Support multiple EC in a system References: <1432309340-13688-1-git-send-email-javier.martinez@collabora.co.uk> <1432309340-13688-7-git-send-email-javier.martinez@collabora.co.uk> <20150527091154.GX11677@x1> <55671F8F.1090500@collabora.co.uk> <20150528142551.GU11677@x1> In-Reply-To: <20150528142551.GU11677@x1> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Lee, [...] On 05/28/2015 04:26 PM, Lee Jones wrote: >> >> >> >> + if (ec_dev->max_passthru) { >> >> + /* >> >> + * Register a PD device as well on top of this device. >> >> + * We make the following assumptions: >> >> + * - behind an EC, we have a pd >> >> + * - only one device added. >> >> + * - the EC is responsive at init time (it is not true for a >> >> + * sensor hub. >> >> + */ >> >> + err = cros_ec_dev_register(ec_dev, dev_id++, 1); >> > >> > I don't really like this devidx business. Just keep it simple and >> > define more than one mfd_cell structure. >> >> I explained to you that this is done because the number of cells depends on >> the system. I can have an array of mfd_cell structures and use the index to >> register but I don't think that is easier to understand. > > Keep it simple. Create a static struct for each and: > > mfd_add_devices(ec_cell) > > if (ec_dev->max_passthru) > mfd_add_devices(ec_pd_cell) > Ok, will do. Thanks a lot for your feedback. Best regards, Javier