summaryrefslogtreecommitdiff
path: root/rust/helpers
diff options
context:
space:
mode:
authorDaniel Almeida <daniel.almeida@collabora.com>2025-08-11 13:03:44 -0300
committerDanilo Krummrich <dakr@kernel.org>2025-08-12 20:33:33 +0200
commit9b6d4fb9804febb1ae75e7259bb475cea58e28a7 (patch)
tree3e02601c39474dd0a6fd623f513b8193f04bc6f6 /rust/helpers
parent17e70f0c549f4a19da7d681d60b552901833f8f3 (diff)
rust: pci: add irq accessors
These accessors can be used to retrieve a irq::Registration or a irq::ThreadedRegistration from a pci device. Alternatively, drivers can retrieve an IrqRequest from a bound PCI device for later use. These accessors ensure that only valid IRQ lines can ever be registered. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Tested-by: Joel Fernandes <joelagnelf@nvidia.com> Tested-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com> Link: https://lore.kernel.org/r/20250811-topics-tyr-request_irq2-v9-6-0485dcd9bcbf@collabora.com Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/helpers')
-rw-r--r--rust/helpers/pci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/rust/helpers/pci.c b/rust/helpers/pci.c
index ef9cb38c81a6..5bf56004478c 100644
--- a/rust/helpers/pci.c
+++ b/rust/helpers/pci.c
@@ -11,3 +11,11 @@ bool rust_helper_dev_is_pci(const struct device *dev)
{
return dev_is_pci(dev);
}
+
+#ifndef CONFIG_PCI_MSI
+int rust_helper_pci_irq_vector(struct pci_dev *pdev, unsigned int nvec)
+{
+ return pci_irq_vector(pdev, nvec);
+}
+
+#endif