From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcel Ziswiler Date: Wed, 9 Aug 2017 08:18:58 +0000 Subject: [U-Boot] [PATCH v2 4/6] pci: tegra: introduce weak tegra_pcie_board_port_reset() function In-Reply-To: References: <20170808124228.5001-1-marcel@ziswiler.com> <20170808124228.5001-5-marcel@ziswiler.com> Message-ID: <1502266736.27304.3.camel@toradex.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On Tue, 2017-08-08 at 10:09 -0600, Stephen Warren wrote: > On 08/08/2017 06:42 AM, Marcel Ziswiler wrote: > > From: Marcel Ziswiler > > > > Introduce a weak tegra_pcie_board_port_reset() function by default > > calling the existing tegra_pcie_port_reset() function. Additionally > > add > > a tegra_pcie_port_index_of_port() function to retrieve the specific > > PCIe > > port index if required. This allows overriding the PCIe port reset > > functionality from board specific code as e.g. required for Apalis > > T30 > > and Apalis TK1. > > diff --git a/include/pci_tegra.h b/include/pci_tegra.h > > +int tegra_pcie_port_index_of_port(void *port); > > + > > +void tegra_pcie_port_reset(void *port); > > The parameter to these functions should be "struct tegra_pcie_port  > *port" for type-safety and to avoid all the casts in the > implementation.  > Since this is a pointer, it doesn't matter that the board-level > callers  > don't have the full type defined since they don't dereference the  > pointer, just pass it around. All you need to do is add the following > to  > the header before the function prototypes: > > struct tegra_pcie_port; Yes, thanks. Of course that makes more sense. I will do that in a v3.