diff options
author | Alan Tull <atull@kernel.org> | 2017-11-15 15:20:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-28 10:30:38 -0500 |
commit | 59460a9305458ac3e7f2415b602dbaa6cfcb8a3b (patch) | |
tree | eecf8b6625b2543db973642cefedccc8e28dd99f /drivers/fpga/fpga-region.c | |
parent | c8898eda81e0b949ca214e1a45ce1b56677eb849 (diff) |
fpga: region: add fpga-region.h header
* Create fpga-region.h.
* Export fpga_region_program_fpga.
* Move struct fpga_region and other things to the header.
This is a step in separating FPGA region common code
from Device Tree support.
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 'drivers/fpga/fpga-region.c')
-rw-r--r-- | drivers/fpga/fpga-region.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c index 2a8621db5f5b..402d0b68b97a 100644 --- a/drivers/fpga/fpga-region.c +++ b/drivers/fpga/fpga-region.c | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <linux/fpga/fpga-bridge.h> | 19 | #include <linux/fpga/fpga-bridge.h> |
20 | #include <linux/fpga/fpga-mgr.h> | 20 | #include <linux/fpga/fpga-mgr.h> |
21 | #include <linux/fpga/fpga-region.h> | ||
21 | #include <linux/idr.h> | 22 | #include <linux/idr.h> |
22 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
23 | #include <linux/list.h> | 24 | #include <linux/list.h> |
@@ -26,24 +27,6 @@ | |||
26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
27 | #include <linux/spinlock.h> | 28 | #include <linux/spinlock.h> |
28 | 29 | ||
29 | /** | ||
30 | * struct fpga_region - FPGA Region structure | ||
31 | * @dev: FPGA Region device | ||
32 | * @mutex: enforces exclusive reference to region | ||
33 | * @bridge_list: list of FPGA bridges specified in region | ||
34 | * @mgr: FPGA manager | ||
35 | * @info: fpga image specific information | ||
36 | */ | ||
37 | struct fpga_region { | ||
38 | struct device dev; | ||
39 | struct mutex mutex; /* for exclusive reference to region */ | ||
40 | struct list_head bridge_list; | ||
41 | struct fpga_manager *mgr; | ||
42 | struct fpga_image_info *info; | ||
43 | }; | ||
44 | |||
45 | #define to_fpga_region(d) container_of(d, struct fpga_region, dev) | ||
46 | |||
47 | static DEFINE_IDA(fpga_region_ida); | 30 | static DEFINE_IDA(fpga_region_ida); |
48 | static struct class *fpga_region_class; | 31 | static struct class *fpga_region_class; |
49 | 32 | ||
@@ -226,7 +209,7 @@ static int fpga_region_get_bridges(struct fpga_region *region, | |||
226 | * Program an FPGA using fpga image info (region->info). | 209 | * Program an FPGA using fpga image info (region->info). |
227 | * Return 0 for success or negative error code. | 210 | * Return 0 for success or negative error code. |
228 | */ | 211 | */ |
229 | static int fpga_region_program_fpga(struct fpga_region *region) | 212 | int fpga_region_program_fpga(struct fpga_region *region) |
230 | { | 213 | { |
231 | struct device *dev = ®ion->dev; | 214 | struct device *dev = ®ion->dev; |
232 | struct fpga_image_info *info = region->info; | 215 | struct fpga_image_info *info = region->info; |
@@ -282,6 +265,7 @@ err_put_region: | |||
282 | 265 | ||
283 | return ret; | 266 | return ret; |
284 | } | 267 | } |
268 | EXPORT_SYMBOL_GPL(fpga_region_program_fpga); | ||
285 | 269 | ||
286 | /** | 270 | /** |
287 | * child_regions_with_firmware | 271 | * child_regions_with_firmware |
@@ -667,5 +651,5 @@ subsys_initcall(fpga_region_init); | |||
667 | module_exit(fpga_region_exit); | 651 | module_exit(fpga_region_exit); |
668 | 652 | ||
669 | MODULE_DESCRIPTION("FPGA Region"); | 653 | MODULE_DESCRIPTION("FPGA Region"); |
670 | MODULE_AUTHOR("Alan Tull <atull@opensource.altera.com>"); | 654 | MODULE_AUTHOR("Alan Tull <atull@kernel.org>"); |
671 | MODULE_LICENSE("GPL v2"); | 655 | MODULE_LICENSE("GPL v2"); |