Skip to contentSkip to conversation

fpga: of-fpga-region: Use platform_set_drvdata

PATCH In review Moritz Fischer 3 participants 5 messages Aug 24, 2018 – Aug 26, 2018

Subsystems (2)
lore
Share & tools
lore

Moritz Fischer

author maintainer
#0 lore raw

PATCH 1/2 fpga: of-fpga-region: Use platform_set_drvdata

Use platform_set_drvdata rather than dev_set_drvdata to match the platform_get_drvdata in the _remove() function of the platform driver.

---
 drivers/fpga/of-fpga-region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/of-fpga-region.c +1 -1
index 35fabb8083fb..8c6120e30930 100644
@@ -421,7 +421,7 @@ static int of_fpga_region_probe(struct platform_device *pdev)
 		goto eprobe_free;
 
 	of_platform_populate(np, fpga_region_of_match, NULL, &region->dev);
-	dev_set_drvdata(dev, region);
+	platform_set_drvdata(pdev, region);
 
 	dev_info(dev, "FPGA Region probed\n");
 
Signature · 1 line
2.18.0
author maintainer
#1 lore raw

PATCH 2/2 fpga: dfl-fme-region: Use platform_get_drvdata()

Use platform_get_drvdata() in remove() function of the platform driver rather than dev_get_drvdata() to match the platform_set_drvdata in the probe().

---
 drivers/fpga/dfl-fme-region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/dfl-fme-region.c +1 -1
index 0b7e19c27c6d..11d3c23a8936 100644
@@ -65,7 +65,7 @@ static int fme_region_probe(struct platform_device *pdev)
 
 static int fme_region_remove(struct platform_device *pdev)
 {
-	struct fpga_region *region = dev_get_drvdata(&pdev->dev);
+	struct fpga_region *region = platform_get_drvdata(pdev);
 
 	fpga_region_unregister(region);
 	fpga_mgr_put(region->mgr);
Signature · 1 line
2.18.0
#2 lore raw

Re: [PATCH 2/2] fpga: dfl-fme-region: Use platform_get_drvdata()

Quoted 3 lines · Moritz Fischer

Use platform_get_drvdata() in remove() function of the platform driver rather than dev_get_drvdata() to match the platform_set_drvdata in the probe().

Hi Moritz,

Thanks for this patch, it looks good to me. : )

Hao

Quoted 21 lines
---
 drivers/fpga/dfl-fme-region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/dfl-fme-region.c +1 -1
index 0b7e19c27c6d..11d3c23a8936 100644
@@ -65,7 +65,7 @@ static int fme_region_probe(struct platform_device *pdev)
 
 static int fme_region_remove(struct platform_device *pdev)
 {
-	struct fpga_region *region = dev_get_drvdata(&pdev->dev);
+	struct fpga_region *region = platform_get_drvdata(pdev);
 
 	fpga_region_unregister(region);
 	fpga_mgr_put(region->mgr);
Signature · 1 line
2.18.0
Acked-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] fpga: dfl-fme-region: Use platform_get_drvdata()

In reply to Moritz Fischer
Quoted 6 lines · Moritz Fischer

Use platform_get_drvdata() in remove() function of the platform driver rather than dev_get_drvdata() to match the platform_set_drvdata in the probe().

Thanks,
Alan

Quoted 20 lines
---
 drivers/fpga/dfl-fme-region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/dfl-fme-region.c +1 -2
index 0b7e19c27c6d..11d3c23a8936 100644
@@ -65,7 +65,7 @@ static int fme_region_probe(struct platform_device *pdev)
 
 static int fme_region_remove(struct platform_device *pdev)
 {
-       struct fpga_region *region = dev_get_drvdata(&pdev->dev);
+       struct fpga_region *region = platform_get_drvdata(pdev);
 
        fpga_region_unregister(region);
        fpga_mgr_put(region->mgr);
--

2.18.0

Acked-by on v1 1/2
#4 lore raw
In reply to Moritz Fischer

On Fri, Aug 24, 2018 at 10:26 AM Moritz Fischer <[email protected]> wrote:

Hi Moritz,

Looks good. Thanks for the patches!

Quoted 6 lines

Use platform_set_drvdata rather than dev_set_drvdata to match the platform_get_drvdata in the _remove() function of the platform driver.

Quoted 20 lines
---
 drivers/fpga/of-fpga-region.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fpga/of-fpga-region.c +1 -2
index 35fabb8083fb..8c6120e30930 100644
@@ -421,7 +421,7 @@ static int of_fpga_region_probe(struct platform_device *pdev)
                goto eprobe_free;
 
        of_platform_populate(np, fpga_region_of_match, NULL, &region->dev);
-       dev_set_drvdata(dev, region);
+       platform_set_drvdata(pdev, region);
 
        dev_info(dev, "FPGA Region probed\n");
 
--

2.18.0