From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Wed, 26 May 2010 13:17:36 -0500 Subject: [U-Boot] [PATCH] powerpc: add support for the Freescale P1022DS reference board In-Reply-To: <4BFD6479.9040408@freescale.com> References: <1274392909-16422-1-git-send-email-timur@freescale.com> <20100520223324.50594CCF026@gemini.denx.de> <20100521070719.5B27BCCF026@gemini.denx.de> <4BFD6479.9040408@freescale.com> Message-ID: <4BFD65C0.7020106@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/26/2010 01:12 PM, Timur Tabi wrote: > Wolfgang Denk wrote: >>>>>> Hm... looks as if you were repeating the same code 3 times. Please make >>>>>> this a function. >>>> >>>> The code isn't really the same. I would need to pass a lot of >>>> parameters to this function: the hose, the devdisr mask, the slot >>>> name, the slot number, the bus number, and so on. > >> Actually it is not that many arguments. > > It is. Here's the prototype I came up with; > > static int configure_pci(enum srds_prtcl pci, > const char *name, > const char *target, > int endpoint, > int first_free_busno, > phys_addr_t mem_addr, > enum law_size mem_size, > phys_addr_t io_addr, > enum law_size io_size, > struct fsl_pci_info *pci_info, > struct pci_controller *hose); > > > Are you sure you would really rather see this as its own function? > Perhaps (most of) this information could be put in a data structure to which you point? -Scott