From: Stephen Warren Date: Tue, 8 Aug 2017 10:09:20 -0600 Subject: [U-Boot] [PATCH v2 4/6] pci: tegra: introduce weak tegra_pcie_board_port_reset() function In-Reply-To: <20170808124228.5001-5-marcel@ziswiler.com> References: <20170808124228.5001-1-marcel@ziswiler.com> <20170808124228.5001-5-marcel@ziswiler.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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;