
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 marcel.ziswiler@toradex.com
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.