lkml.org 
[lkml]   [2017]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC 2/2] fpga: of region: add of-fpga-region to whitelist
Date
During each FPGA region's probe, add to whitelist.  Remove
during driver remove.

Signed-off-by: Alan Tull <atull@kernel.org>
---
drivers/fpga/of-fpga-region.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
index 7dfaa95..abb57a9 100644
--- a/drivers/fpga/of-fpga-region.c
+++ b/drivers/fpga/of-fpga-region.c
@@ -435,6 +435,10 @@ static int of_fpga_region_probe(struct platform_device *pdev)
/* Specify how to get bridges for this type of region. */
region->get_bridges = of_fpga_region_get_bridges;

+ ret = of_add_whitelist_node(np);
+ if (ret)
+ goto eprobe_wl_err;
+
ret = fpga_region_register(region);
if (ret)
goto eprobe_mgr_put;
@@ -447,6 +451,8 @@ static int of_fpga_region_probe(struct platform_device *pdev)
return 0;

eprobe_mgr_put:
+ of_remove_whitelist_node(np);
+eprobe_wl_err:
fpga_mgr_put(mgr);
return ret;
}
@@ -454,7 +460,10 @@ static int of_fpga_region_probe(struct platform_device *pdev)
static int of_fpga_region_remove(struct platform_device *pdev)
{
struct fpga_region *region = platform_get_drvdata(pdev);
+ struct device *dev = &pdev->dev;
+ struct device_node *np = dev->of_node;

+ of_remove_whitelist_node(np);
fpga_region_unregister(region);
fpga_mgr_put(region->mgr);

--
2.7.4
\
 
 \ /
  Last update: 2017-11-27 22:18    [W:0.219 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site