[PATCH 0/2] PCI: endpoint: Set .owner = THIS_MODULE in struct pci_epc_ops

From: Ian Rogers

Date: Thu Dec 03 2026 - 12:17:33 EST


pci_epc_get() / pci_epc_put() reference count epc->ops->owner, while
none of the four struct pci_epc_ops definitions under
drivers/pci/controller/ initialize .owner:

1. pcie-cadence-ep (tristate CONFIG_PCIE_CADENCE_EP) - fixes missing
module pinning when built as a module (has Fixes tag).
2. pcie-designware-ep, pcie-rcar-ep, and pcie-rockchip-ep (currently
bool) - initialized for consistency and to prepare for annotating
pci_epc_ops::owner with __must_init.

Tooling note: Found using Clang's require_explicit_initialization
attribute; an AI coding assistant helped audit call sites, verify Kconfig
module eligibility and Fixes commits, and draft the changelogs. All four
files were build-tested with LLVM=1.

Ian Rogers (2):
PCI: cadence: Set .owner = THIS_MODULE in cdns_pcie_epc_ops
PCI: endpoint: Set .owner = THIS_MODULE in remaining pci_epc_ops

drivers/pci/controller/cadence/pcie-cadence-ep.c | 1 +
drivers/pci/controller/dwc/pcie-designware-ep.c | 2 ++
drivers/pci/controller/pcie-rcar-ep.c | 2 ++
drivers/pci/controller/pcie-rockchip-ep.c | 2 ++
4 files changed, 7 insertions(+)


base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
--
2.56.1.839.g22a8290db9-goog