2018-08-24 15:31:01

by Moritz Fischer

[permalink] [raw]
Subject: [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.

Signed-off-by: Moritz Fischer <[email protected]>
---
drivers/fpga/of-fpga-region.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
index 35fabb8083fb..8c6120e30930 100644
--- a/drivers/fpga/of-fpga-region.c
+++ b/drivers/fpga/of-fpga-region.c
@@ -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



2018-08-24 15:28:59

by Moritz Fischer

[permalink] [raw]
Subject: [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().

Signed-off-by: Moritz Fischer <[email protected]>
---
drivers/fpga/dfl-fme-region.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/fpga/dfl-fme-region.c b/drivers/fpga/dfl-fme-region.c
index 0b7e19c27c6d..11d3c23a8936 100644
--- a/drivers/fpga/dfl-fme-region.c
+++ b/drivers/fpga/dfl-fme-region.c
@@ -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


2018-08-24 18:31:07

by Wu Hao

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

On Fri, Aug 24, 2018 at 08:25:13AM -0700, Moritz Fischer wrote:
> 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

>
> Signed-off-by: Moritz Fischer <[email protected]>
> ---
> drivers/fpga/dfl-fme-region.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fpga/dfl-fme-region.c b/drivers/fpga/dfl-fme-region.c
> index 0b7e19c27c6d..11d3c23a8936 100644
> --- a/drivers/fpga/dfl-fme-region.c
> +++ b/drivers/fpga/dfl-fme-region.c
> @@ -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

2018-08-26 21:22:36

by Alan Tull

[permalink] [raw]
Subject: Re: [PATCH 1/2] fpga: of-fpga-region: Use platform_set_drvdata

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

Hi Moritz,

Looks good. Thanks for the patches!

>
> Use platform_set_drvdata rather than dev_set_drvdata
> to match the platform_get_drvdata in the _remove()
> function of the platform driver.
>
> Signed-off-by: Moritz Fischer <[email protected]>
Acked-by: Alan Tull <[email protected]>

> ---
> drivers/fpga/of-fpga-region.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
> index 35fabb8083fb..8c6120e30930 100644
> --- a/drivers/fpga/of-fpga-region.c
> +++ b/drivers/fpga/of-fpga-region.c
> @@ -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
>

2018-08-26 21:23:22

by Alan Tull

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

On Fri, Aug 24, 2018 at 10:26 AM Moritz Fischer <[email protected]> wrote:
>
> 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().
>
> Signed-off-by: Moritz Fischer <[email protected]>
Acked-by: Alan Tull <[email protected]>

Thanks,
Alan


> ---
> drivers/fpga/dfl-fme-region.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fpga/dfl-fme-region.c b/drivers/fpga/dfl-fme-region.c
> index 0b7e19c27c6d..11d3c23a8936 100644
> --- a/drivers/fpga/dfl-fme-region.c
> +++ b/drivers/fpga/dfl-fme-region.c
> @@ -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
>