diff options
author | Alan Tull <atull@kernel.org> | 2017-11-15 14:20:13 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-28 16:30:37 +0100 |
commit | ebf877a51ad7b65e4ab024f021b60a4f7928864a (patch) | |
tree | cca7dfc760c45f32bdbd9e6f69106dd24651d468 /include/linux/fpga | |
parent | 5cf0c7f6502f26332b46fa87914553a4d6ae75ac (diff) |
fpga: mgr: separate getting/locking FPGA manager
Previously when the user gets a FPGA manager, it was locked
and nobody else could use it for programming.
This commit makes it straightforward to save a reference to an
FPGA manager and only lock it when programming the FPGA.
Add functions that get an FPGA manager's mutex for exclusive use:
* fpga_mgr_lock
* fpga_mgr_unlock
The following functions no longer lock an FPGA manager's mutex:
* of_fpga_mgr_get
* fpga_mgr_get
* fpga_mgr_put
Signed-off-by: Alan Tull <atull@kernel.org>
Acked-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/fpga')
-rw-r--r-- | include/linux/fpga/fpga-mgr.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h index 6b791348023b..cb5615c87504 100644 --- a/include/linux/fpga/fpga-mgr.h +++ b/include/linux/fpga/fpga-mgr.h @@ -155,6 +155,9 @@ void fpga_image_info_free(struct fpga_image_info *info); int fpga_mgr_load(struct fpga_manager *mgr, struct fpga_image_info *info); +int fpga_mgr_lock(struct fpga_manager *mgr); +void fpga_mgr_unlock(struct fpga_manager *mgr); + struct fpga_manager *of_fpga_mgr_get(struct device_node *node); struct fpga_manager *fpga_mgr_get(struct device *dev); |