Skip to contentSkip to conversation

fpga: dfl: region: Restory symmetry in probe()/remove()

PATCH In review Moritz Fischer 2 participants 4 messages Aug 20, 2018

Subsystems (2)
lore
Share & tools
lore

Moritz Fischer

author maintainer
#0 lore raw

PATCH v2 1/1 fpga: dfl: region: Restory symmetry in probe()/remove()

Replace dev_get_drvdata() with platform_get_drvdata() to match the platform_set_drvdata() in the probe function of the platform driver.

Fixes commit bb61b9be3e6b ("fpga: dfl: add fpga region platform driver for FME")

---

Changes from v1:
- Still compile after change ...

---
 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
#1 lore raw

On Mon, Aug 20, 2018 at 12:18 PM, Moritz Fischer <[email protected]> wrote:

Hi Moritz,

Quoted 5 lines

Replace dev_get_drvdata() with platform_get_drvdata() to match the platform_set_drvdata() in the probe function of the platform driver.

Fixes commit bb61b9be3e6b ("fpga: dfl: add fpga region platform driver for FME")

Quoted 8 lines

---

Changes from v1:
- Still compile after change ...

---
 drivers/fpga/dfl-fme-region.c | 2 +-

Thanks for catching this. of-fpga-region.c does a similar thing and needs s/dev_set_drvdata/platform_set_drvdata/ in the probe. Could you fix it here too?

Alan

Quoted 18 lines
 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

author maintainer
#2 lore raw

Hi Alan,

Quoted 15 lines · Alan Tull

On Mon, Aug 20, 2018 at 12:18 PM, Moritz Fischer <[email protected]> wrote:

Hi Moritz,

Quoted 11 lines

Replace dev_get_drvdata() with platform_get_drvdata() to match the platform_set_drvdata() in the probe function of the platform driver.

Fixes commit bb61b9be3e6b ("fpga: dfl: add fpga region platform driver for FME")

---

Changes from v1:
- Still compile after change ...

Quoted 6 lines
Quoted 2 lines
---
 drivers/fpga/dfl-fme-region.c | 2 +-

Thanks for catching this. of-fpga-region.c does a similar thing and needs s/dev_set_drvdata/platform_set_drvdata/ in the probe. Could you fix it here too?

Yeah, can do in a v3 series ... Will add your Suggested-by: ...

Cheers,

Moritz

#3 lore raw
Quoted 24 lines · Moritz Fischer

Hi Alan,

Quoted 21 lines · Alan Tull

On Mon, Aug 20, 2018 at 12:18 PM, Moritz Fischer <[email protected]> wrote:

Hi Moritz,

Quoted 5 lines

Replace dev_get_drvdata() with platform_get_drvdata() to match the platform_set_drvdata() in the probe function of the platform driver.

Fixes commit bb61b9be3e6b ("fpga: dfl: add fpga region platform driver for FME")

Quoted 8 lines

---

Changes from v1:
- Still compile after change ...

---
 drivers/fpga/dfl-fme-region.c | 2 +-

Thanks for catching this. of-fpga-region.c does a similar thing and needs s/dev_set_drvdata/platform_set_drvdata/ in the probe. Could you fix it here too?

Actually I should have said something more like
s/dev_set_drvdata(dev/platform_set_drvdata(pdev/

Quoted 2 lines

Yeah, can do in a v3 series ... Will add your Suggested-by: ...

Thanks!

Quoted 4 lines

Cheers,

Moritz