linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Tull <atull@kernel.org>
To: Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Cc: Moritz Fischer <mdf@kernel.org>, Alan Tull <atull@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-fpga@vger.kernel.org
Subject: [RFC 2/2] fpga: of region: add of-fpga-region to whitelist
Date: Mon, 27 Nov 2017 14:58:04 -0600	[thread overview]
Message-ID: <1511816284-12145-3-git-send-email-atull@kernel.org> (raw)
In-Reply-To: <1511816284-12145-1-git-send-email-atull@kernel.org>

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

  parent reply	other threads:[~2017-11-27 21:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 20:58 [RFC 0/2] of: Add whitelist Alan Tull
2017-11-27 20:58 ` [RFC 1/2] of: overlay: add whitelist Alan Tull
2017-11-28 15:15   ` Rob Herring
2017-11-28 19:26     ` Alan Tull
2017-11-29  9:25       ` Frank Rowand
2017-11-27 20:58 ` Alan Tull [this message]
2017-11-29  9:20 ` [RFC 0/2] of: Add whitelist Frank Rowand
2017-11-29 13:31   ` Rob Herring
2017-11-29 16:11     ` Alan Tull
2017-11-30 12:46       ` Frank Rowand
2017-12-05 16:33         ` Alan Tull
2017-12-06 11:56           ` Frank Rowand
2017-12-07 19:22             ` Alan Tull
2017-11-30 12:18     ` Frank Rowand
2017-12-05 16:55       ` Alan Tull
2017-12-06 11:47         ` Frank Rowand
2017-11-29 22:47   ` Frank Rowand
2017-11-30 14:39     ` Rob Herring
2017-12-06 11:44       ` Frank Rowand
2017-11-30  0:58   ` Frank Rowand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1511816284-12145-3-git-send-email-atull@kernel.org \
    --to=atull@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).