summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/fpga/zynq-fpga.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c
index 31db5509f3d4..c2fb4120bd62 100644
--- a/drivers/fpga/zynq-fpga.c
+++ b/drivers/fpga/zynq-fpga.c
@@ -416,7 +416,6 @@ static int zynq_fpga_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
- platform_set_drvdata(pdev, priv);
priv->dev = dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -477,10 +476,12 @@ static int zynq_fpga_probe(struct platform_device *pdev)
static int zynq_fpga_remove(struct platform_device *pdev)
{
struct zynq_fpga_priv *priv;
+ struct fpga_manager *mgr;
- fpga_mgr_unregister(&pdev->dev);
+ mgr = platform_get_drvdata(pdev);
+ priv = mgr->priv;
- priv = platform_get_drvdata(pdev);
+ fpga_mgr_unregister(&pdev->dev);
clk_unprepare(priv->clk);