From: atull@opensource.altera.com (atull)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 3/3] fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000
Date: Thu, 22 Oct 2015 12:56:51 -0500 [thread overview]
Message-ID: <alpine.DEB.2.02.1510221247360.23148@linuxheads99> (raw)
In-Reply-To: <1445035350-3569-4-git-send-email-moritz.fischer@ettus.com>
On Fri, 16 Oct 2015, Moritz Fischer wrote:
Hi Moritz,
I just noticed a problem regarding private data. Fortunately
it is easy to fix. See below...
> +static int zynq_fpga_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct zynq_fpga_priv *priv;
> + struct resource *res;
> + int err;
> +
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + platform_set_drvdata(pdev, priv);
fpga-mgr.c uses drvdata for its struct fpga_manager, so this will
get overwritten. So remove this platform_set_drvdata(). priv
is saved in struct fpga_manager during fpga_mgr_register().
...
> +static int zynq_fpga_remove(struct platform_device *pdev)
> +{
Here you can get a pointer to priv from the fpga_manager struct:
struct fpga_manager *mgr = platform_get_drvdata(pdev);
struct zynq_fpga_priv *priv = mgr->priv;
Alan
> + struct zynq_fpga_priv *priv;
> +
> + fpga_mgr_unregister(&pdev->dev);
> +
> + priv = platform_get_drvdata(pdev);
> +
> + clk_disable_unprepare(priv->clk);
> +
> + return 0;
> +}
next prev parent reply other threads:[~2015-10-22 17:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 22:42 [PATCHv2 0/3] Adding FPGA Manager support for Xilinx Zynq Moritz Fischer
2015-10-16 22:42 ` [PATCHv2 1/3] ARM: dt: fpga: Added binding docs for Xilinx Zynq FPGA manager Moritz Fischer
2015-10-18 17:51 ` Josh Cartwright
2015-10-19 2:24 ` Sören Brinkmann
2015-10-16 22:42 ` [PATCHv2 2/3] ARM: zynq: dt: Updated devicetree for Zynq 7000 platform Moritz Fischer
2015-10-18 17:53 ` Josh Cartwright
2015-10-19 14:09 ` Michal Simek
2015-10-19 18:24 ` Josh Cartwright
2015-10-20 11:15 ` Michal Simek
2015-10-16 22:42 ` [PATCHv2 3/3] fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000 Moritz Fischer
2015-10-18 18:02 ` Josh Cartwright
2015-10-19 16:28 ` Moritz Fischer
2015-10-22 17:56 ` atull [this message]
2015-10-22 18:38 ` Moritz Fischer
2015-10-18 19:08 ` [PATCHv2 0/3] Adding FPGA Manager support for Xilinx Zynq Josh Cartwright
2015-10-19 14:12 ` Michal Simek
2015-10-19 16:25 ` Moritz Fischer
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=alpine.DEB.2.02.1510221247360.23148@linuxheads99 \
--to=atull@opensource.altera.com \
--cc=linux-arm-kernel@lists.infradead.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