diff options
Diffstat (limited to 'rust/helpers.c')
-rw-r--r-- | rust/helpers.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rust/helpers.c b/rust/helpers.c index ab39c0a81c7a..319371440d43 100644 --- a/rust/helpers.c +++ b/rust/helpers.c @@ -30,6 +30,7 @@ #include <linux/highmem.h> #include <linux/io.h> #include <linux/mutex.h> +#include <linux/pci.h> #include <linux/rcupdate.h> #include <linux/refcount.h> #include <linux/sched/signal.h> @@ -327,6 +328,23 @@ int rust_helper_devm_add_action(struct device *dev, void (*action)(void *), void } EXPORT_SYMBOL_GPL(rust_helper_devm_add_action); +void rust_helper_pci_set_drvdata(struct pci_dev *pdev, void *data) +{ + pci_set_drvdata(pdev, data); +} +EXPORT_SYMBOL_GPL(rust_helper_pci_set_drvdata); + +void *rust_helper_pci_get_drvdata(struct pci_dev *pdev) +{ + return pci_get_drvdata(pdev); +} +EXPORT_SYMBOL_GPL(rust_helper_pci_get_drvdata); + +u64 rust_helper_pci_resource_len(struct pci_dev *pdev, int barnr) +{ + return pci_resource_len(pdev, barnr); +} + /* * `bindgen` binds the C `size_t` type as the Rust `usize` type, so we can * use it in contexts where Rust expects a `usize` like slice (array) indices. |