From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XAbVF-00027L-FD for barebox@lists.infradead.org; Fri, 25 Jul 2014 09:09:26 +0000 Message-ID: <1406279230.4643.11.camel@weser.hi.pengutronix.de> From: Lucas Stach Date: Fri, 25 Jul 2014 11:07:10 +0200 In-Reply-To: <1406107568-8440-4-git-send-email-sebastian.hesselbarth@gmail.com> References: <1406107568-8440-1-git-send-email-sebastian.hesselbarth@gmail.com> <1406107568-8440-4-git-send-email-sebastian.hesselbarth@gmail.com> Mime-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH RESEND 3/6] pci: add host controller struct to sysdata To: Sebastian Hesselbarth Cc: Thomas Petazzoni , barebox@lists.infradead.org Am Mittwoch, den 23.07.2014, 11:26 +0200 schrieb Sebastian Hesselbarth: > struct pci_bus allows to set some private sysdata. Assign the host > controller struct to it by default. > > Signed-off-by: Sebastian Hesselbarth > --- > To: barebox@lists.infradead.org > To: Sebastian Hesselbarth > Cc: Antony Pavlov > Cc: Jean-Christophe PLAGNIOL-VILLARD > Cc: Thomas Petazzoni > Cc: Ezequiel Garcia > --- > drivers/pci/pci.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index e5cd8a33b2be..b30cdd96f8ca 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -39,6 +39,7 @@ void register_pci_controller(struct pci_controller *hose) > bus->ops = hose->pci_ops; > bus->resource[0] = hose->mem_resource; > bus->resource[1] = hose->io_resource; > + bus->sysdata = hose; > This doesn't seem right. You are not only assigning hose to sysdata by default, but make it the only option as there is no sane way to override this assignment before bus scanning happens. Either make this a parameter to this function, so pci host controller drivers can pass in whatever they want as the sysdata, or add an explicit backlink pointer from bus to controller. Hm, maybe even both. Regards, Lucas -- Pengutronix e.K. | Lucas Stach | Industrial Linux Solutions | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox