]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: artpec6: Implement dw_pcie_ep operation get_features
authorNiklas Cassel <cassel@kernel.org>
Fri, 13 Dec 2024 14:33:05 +0000 (15:33 +0100)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Wed, 18 Dec 2024 21:51:47 +0000 (21:51 +0000)
All non-DWC EPC drivers implement (struct pci_epc *)->ops->get_features().
All DWC EPC drivers implement (struct dw_pcie_ep *)->ops->get_features(),
except for pcie-artpec6.c.

epc_features has been required in pci-epf-test.c since commit 6613bc2301ba
("PCI: endpoint: Fix NULL pointer dereference for ->get_features()").

A follow-up commit will make further use of epc_features in EPC core code.

Implement epc_features in the only EPC driver where it is currently not
implemented.

Link: https://lore.kernel.org/r/20241213143301.4158431-12-cassel@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
drivers/pci/controller/dwc/pcie-artpec6.c

index f8e7283dacd4727dad5daf3b9d2e91405af96bb3..234c8cbcae3af9970c848578c5a924a2449f1975 100644 (file)
@@ -369,9 +369,22 @@ static int artpec6_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
        return 0;
 }
 
+static const struct pci_epc_features artpec6_pcie_epc_features = {
+       .linkup_notifier = false,
+       .msi_capable = true,
+       .msix_capable = false,
+};
+
+static const struct pci_epc_features *
+artpec6_pcie_get_features(struct dw_pcie_ep *ep)
+{
+       return &artpec6_pcie_epc_features;
+}
+
 static const struct dw_pcie_ep_ops pcie_ep_ops = {
        .init = artpec6_pcie_ep_init,
        .raise_irq = artpec6_pcie_raise_irq,
+       .get_features = artpec6_pcie_get_features,
 };
 
 static int artpec6_pcie_probe(struct platform_device *pdev)