[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1964262.h2oIOhyNUf@wuerfel>
Date: Sat, 30 Apr 2016 00:50:11 +0200
From: Arnd Bergmann <arnd@...db.de>
To: linux-arm-kernel@...ts.infradead.org
Cc: catalin.marinas@....com, linaro-acpi@...ts.linaro.org,
linux-pci@...r.kernel.org, will.deacon@....com,
okaya@...eaurora.org, wangyijing@...wei.com,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Tomasz Nowicki <tn@...ihalf.com>, rafael@...nel.org,
ddaney@...iumnetworks.com, linux-acpi@...r.kernel.org,
robert.richter@...iumnetworks.com,
Bjorn Helgaas <helgaas@...nel.org>, msalter@...hat.com,
Liviu.Dudau@....com, mw@...ihalf.com, jcm@...hat.com,
jchandra@...adcom.com, linux-kernel@...r.kernel.org,
hanjun.guo@...aro.org, Suravee.Suthikulpanit@....com,
jiang.liu@...ux.intel.com
Subject: Re: [PATCH V6 02/13] pci, acpi: Provide generic way to assign bus domain number.
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
Powered by blists - more mailing lists