Thread (17 messages) read the whole thread 17 messages, 5 authors, 2015-10-22

Re: [PATCHv2 3/3] fpga manager: Adding FPGA Manager support for Xilinx Zynq 7000

From: Moritz Fischer <moritz.fischer@ettus.com>
Date: 2015-10-22 18:38:40
Also in: linux-arm-kernel, lkml

Hi Alan,

On Thu, Oct 22, 2015 at 10:56 AM, atull [off-list ref] wrote:
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...
quoted
+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().
Ouch, I missed that.
...
quoted
+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;
Thanks, will submit a follow up patch.
quoted
+     struct zynq_fpga_priv *priv;
+
+     fpga_mgr_unregister(&pdev->dev);
+
+     priv = platform_get_drvdata(pdev);
+
+     clk_disable_unprepare(priv->clk);
+
+     return 0;
+}>
Alan
Cheers,

Moritz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help