[PATCH RESEND 3/6] pci: add host controller struct to sysdata

Lucas Stach l.stach at pengutronix.de
Fri Jul 25 02:07:10 PDT 2014


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 <sebastian.hesselbarth at gmail.com>
> ---
> To: barebox at lists.infradead.org
> To: Sebastian Hesselbarth <sebastian.hesselbarth at gmail.com>
> Cc: Antony Pavlov <antonynpavlov at gmail.com>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
> Cc: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
> ---
>  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/  |




More information about the barebox mailing list