Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752356AbcD2Wv2 (ORCPT ); Fri, 29 Apr 2016 18:51:28 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:63141 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751153AbcD2Wv0 (ORCPT ); Fri, 29 Apr 2016 18:51:26 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, will.deacon@arm.com, okaya@codeaurora.org, wangyijing@huawei.com, Lorenzo Pieralisi , Tomasz Nowicki , rafael@kernel.org, ddaney@caviumnetworks.com, linux-acpi@vger.kernel.org, robert.richter@caviumnetworks.com, Bjorn Helgaas , msalter@redhat.com, Liviu.Dudau@arm.com, mw@semihalf.com, jcm@redhat.com, jchandra@broadcom.com, linux-kernel@vger.kernel.org, hanjun.guo@linaro.org, Suravee.Suthikulpanit@amd.com, jiang.liu@linux.intel.com Subject: Re: [PATCH V6 02/13] pci, acpi: Provide generic way to assign bus domain number. Date: Sat, 30 Apr 2016 00:50:11 +0200 Message-ID: <1964262.h2oIOhyNUf@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1614997.P8lXtkpXQq@wuerfel> References: <1460740008-19489-1-git-send-email-tn@semihalf.com> <20160428150815.GB15598@localhost> <1614997.P8lXtkpXQq@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:8nhmyWs8y1/BXbw6NmforhrKAXjrnrd3Le/AovnBsZYyRRRTbcV BRkX11AwyvRTQ5lJelhkK2GfWDeCZGmm6uwaxJIdXptycPQwbfek9ARZZd8qQZ5WbyZ7TTK KD5gT9J0EUMeJWBo/kHC9a8ywZPAJvQ6iJkv50fFBifB/FYUm+2aN3d28p6Bt5JjIwirqZG txA7Iyh0KTKBe2ox5unJQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Qp8rdUqFlGc=:ODM0BUCLnC7TM0jmb91V7O IR1FDU4jbxmLWTVaCNEMzmvJHzg28W78+GCmCVoqjrwIr90YmdxrXBgULK/kkn59NOuBmXeVC gOPGvIciDBX6l4/pwVPEJm1mNuVgJ/hlZ9yEL80U7c/j3WvNR8jx8DLECP2jJP8+DjkiMBaB6 RdzHFTFWLgaiV0WhRjS/QCWbkI2Gog4/rfpRaU8i552ycapHOALnRloZ5nknllKRjMI1/jrIt O3DSBLphIRrkQuP0T9lp9ixl98b4sUf67D7G3yp1UpIHdV88Cb2Xzn71kM7xEWeCHBFwJXUgv KTUak3Uajxx97fDzImiX9QKtsmssnTYnV4xekZ8Ih5Lwhkesiww5XXnqYPiaAerReaUWiB4/+ uoPsRNIyr7MdSUSSrfFU9bR2zfWt3kfbYuxr6povXZJnT7/qxxXVDQowEYDQBaOj4SsQWzHNh 4ufiVqqXcwYar1PrPD7rkbCNjlsCuUSqtp5i5k80U31FvzRww7DeTbVzoBYFVHHHlSuSHSDbV 2HSBCMjjEcLlQbkAino++C2rMM2povSrkLs295EcjUaBNf1+Z6lOS74k+gzBr5Kdw27iCB4La OPpBYmE58DKcnl8Hx3jjmaTSPbUgcvp5Y+/SgczRUoZintC0VYEY/jelRqsEQLNI6YI/H8g3P 5ejjqxC7k5wLsPaY0LhRk6YVFB1jcsulZlk9kS1m7bhMhPITQIo7wMCgPQk34YYT8VH7QgUU7 uOplivmRRIsqBw8Q Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1370 Lines: 31 On Thursday 28 April 2016 17:34:10 Arnd Bergmann wrote: > On Thursday 28 April 2016 10:12:12 Bjorn Helgaas wrote: > > Right, we don't have a good mechanism for passing more info into > > pci_create_root_bus(). Maybe the caller could fill in a struct so we > > have a chance to extend it without having to change all the existing > > callers. > > > > I wonder if there's a design pattern we can copy, e.g., would > > something like the scsi_host_alloc(), scsi_add_host(), > > scsi_scan_host() model work here? > > Yes, I think that is a good idea in general. Especially > now that we have separate the ARM code from pci_common_init_dev > and pci_sys_data, that can help with cleanups in the other drivers > as well. > > I see two common variations in other subsystems: some use a > special alloc() function that you pass the size of the private > data into, while others just expect you to embed a structure > inside of the driver specific one allocate that separately to > have the generic registration function fill out the common fields. > > I have a slight preference for the second, but they are really > the same thing basically. I've tried this out now, and will follow up with a separate patch series. Overall, I think it works out well, though I haven't gotten to the point of actually saving code yet. I've converted two drivers for demonstration. Arnd