Skip to contentSkip to conversation

fpga: add method to get fpga manager from device

PATCH Superseded Alan Tull 1 participant 1 message Oct 19, 2016

Subsystems (2)

v1 of 21 Superseded Latest is v21 →

lore
Share & tools
lore

Alan Tull

author
#0 lore raw

PATCH 1/1 fpga: add method to get fpga manager from device

The intent is to provide a non-DT method of getting ahold of a FPGA manager to do some FPGA programming.

This patch refactors of_fpga_mgr_get() to reuse most of it while adding a new method fpga_mgr_get() for getting a pointer to a fpga manager struct, given the device.

---
 Documentation/fpga/fpga-mgr.txt |  6 ++--
 drivers/fpga/fpga-mgr.c         | 76 +++++++++++++++++++++++++++++------------
 include/linux/fpga/fpga-mgr.h   |  2 ++
 3 files changed, 60 insertions(+), 24 deletions(-)
Documentation/fpga/fpga-mgr.txt +4 -2
index 9227e3f..087924f 100644
@@ -42,11 +42,13 @@ To get/put a reference to a FPGA manager:
 -----------------------------------------
 
 	struct fpga_manager *of_fpga_mgr_get(struct device_node *node);
+	struct fpga_manager *fpga_mgr_get(struct device *dev);
+
+Given a DT node or device, get an exclusive reference to a FPGA manager.
 
 	void fpga_mgr_put(struct fpga_manager *mgr);
 
-Given a DT node, get an exclusive reference to a FPGA manager or release
-the reference.
+Release the reference.
 
 
 To register or unregister the low level FPGA-specific driver:
drivers/fpga/fpga-mgr.c +54 -22

104 lines not on this page · raw message

include/linux/fpga/fpga-mgr.h +2 -0
index 12f6207..96a1a33 100644
@@ -134,6 +134,8 @@ int fpga_mgr_firmware_load(struct fpga_manager *mgr,
 
 struct fpga_manager *of_fpga_mgr_get(struct device_node *node);
 
+struct fpga_manager *fpga_mgr_get(struct device *dev);
+
 void fpga_mgr_put(struct fpga_manager *mgr);
 
 int fpga_mgr_register(struct device *dev, const char *name,
Signature · 1 line
2.10.1