fpga: mgr: separate getting/locking FPGA manager
authorAlan Tull <atull@kernel.org>
Wed, 15 Nov 2017 20:20:13 +0000 (14:20 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2017 15:30:37 +0000 (16:30 +0100)
commitebf877a51ad7b65e4ab024f021b60a4f7928864a
treecca7dfc760c45f32bdbd9e6f69106dd24651d468
parent5cf0c7f6502f26332b46fa87914553a4d6ae75ac
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>
Documentation/fpga/fpga-mgr.txt
drivers/fpga/fpga-mgr.c
drivers/fpga/fpga-region.c
include/linux/fpga/fpga-mgr.h