Subsystems (3)
Moritz Fischer
maintainerSubject: [PATCH v2 00/10] Introduce devm_fpga_mgr_register()
This patchset introduces the devm_fpga_mgr_register API, a devres managed version of fpga_mgr_register().
It reduces boilerplate being repeated literally in every single driver by moving it to the fpga-mgr core.
Changes from v1:
- Addressed Hao's feedback
- priv -> res
- comment style
- use fpga_mgr_devres consistently
- Addressed Tom's feedback
- err -> ret
- removed removal of deprecated API
- added Reviewed-by: tags
Moritz Fischer (10):
fpga: fpga-mgr: Add devm_fpga_mgr_register() API
fpga: fpga-mgr: altera-ps-spi: Simplify registration
fpga: fpga-mgr: dfl-fme-mgr: Simplify registration
fpga: fpga-mgr: ice40-spi: Simplify registration
fpga: fpga-mgr: machxo2-spi: Simplify registration
fpga: fpga-mgr: socfpga: Simplify registration
fpga: fpga-mgr: ts73xx: Simplify registration
fpga: fpga-mgr: xilinx-spi: Simplify registration
fpga: fpga-mgr: zynqmp: Simplify registration
fpga: fpga-mgr: altera-pr-ip: Simplify registration
drivers/fpga/altera-pr-ip-core-plat.c | 10 ---- drivers/fpga/altera-pr-ip-core.c | 14 +---- drivers/fpga/altera-ps-spi.c | 14 +---- drivers/fpga/dfl-fme-mgr.c | 12 +--- drivers/fpga/fpga-mgr.c | 76 ++++++++++++++++++++++---- drivers/fpga/ice40-spi.c | 14 +---- drivers/fpga/machxo2-spi.c | 14 +---- drivers/fpga/socfpga.c | 14 +---- drivers/fpga/ts73xx-fpga.c | 14 +---- drivers/fpga/xilinx-spi.c | 14 +---- drivers/fpga/zynqmp-fpga.c | 21 +------ include/linux/fpga/altera-pr-ip-core.h | 1 - include/linux/fpga/fpga-mgr.h | 2 + 13 files changed, 77 insertions(+), 143 deletions(-)
Signature · 1 line
2.28.0
Moritz Fischer
maintainerPATCH v2 1/10 fpga: fpga-mgr: Add devm_fpga_mgr_register() API
Add a devm_fpga_mgr_register() API that can be used to register a FPGA Manager that was created using devm_fpga_mgr_create().
Introduce a struct fpga_mgr_devres that makes the devres allocation a little bit more readable and gets reused for devm_fpga_mgr_create() devm_fpga_mgr_register().
--- drivers/fpga/fpga-mgr.c | 81 +++++++++++++++++++++++++++++------ include/linux/fpga/fpga-mgr.h | 2 + 2 files changed, 71 insertions(+), 12 deletions(-)
drivers/fpga/fpga-mgr.c +69 -12
@@ -21,6 +21,10 @@static DEFINE_IDA (fpga_mgr_ida);static struct class *fpga_mgr_class; +struct fpga_mgr_devres { +struct fpga_manager *mgr; +}; +/** * fpga_image_info_alloc - Allocate a FPGA image info struct * @dev: owning device
@@ -625,9 +629,9 @@ EXPORT_SYMBOL_GPL(fpga_mgr_free);static void devm_fpga_mgr_release (struct device *dev,void *res) { -struct fpga_manager *mgr = *(struct fpga_manager **)res; +struct fpga_mgr_devres *dr = res; -fpga_mgr_free (mgr); +fpga_mgr_free (dr->mgr); }/**
@@ -651,21 +655,21 @@ struct fpga_manager *devm_fpga_mgr_create(struct device *dev, const char *name,const struct fpga_manager_ops *mops, void *priv) { - struct fpga_manager **ptr, *mgr; + struct fpga_mgr_devres *dr; - ptr =devres_alloc (devm_fpga_mgr_release,sizeof (*ptr),GFP_KERNEL ); -if (!ptr) + dr =devres_alloc (devm_fpga_mgr_release,sizeof (*dr),GFP_KERNEL ); +if (!dr)return NULL ; - mgr =fpga_mgr_create (dev, name, mops, priv); -if (!mgr) { -devres_free (ptr); - }else { - *ptr = mgr; -devres_add (dev, ptr); + dr->mgr =fpga_mgr_create (dev, name, mops, priv); +if (!dr->mgr) { +devres_free (dr); +return NULL ; } -return mgr; +devres_add (dev, dr); + +return dr->mgr; }EXPORT_SYMBOL_GPL (devm_fpga_mgr_create);
@@ -722,6 +726,59 @@ void fpga_mgr_unregister(struct fpga_manager *mgr) }EXPORT_SYMBOL_GPL (fpga_mgr_unregister); +static int fpga_mgr_devres_match (struct device *dev,void *res, +void *match_data) +{ +struct fpga_mgr_devres *dr = res; + +return match_data == dr->mgr; +} + +static void devm_fpga_mgr_unregister (struct device *dev,void *res) +{ +struct fpga_mgr_devres *dr = res; + +fpga_mgr_unregister (dr->mgr); +} + +/** +* devm_fpga_mgr_register - resource managed variant of fpga_mgr_register() +* @dev: managing device for this FPGA manager +* @mgr: fpga manager struct +* +* This is the devres variant of fpga_mgr_register() for which the unregister +* function will be called automatically when the managing device is detached. +*/ +int devm_fpga_mgr_register (struct device *dev,struct fpga_manager *mgr) +{ +struct fpga_mgr_devres *dr; +int ret; + +/* +* Make sure that the struct fpga_manager * that is passed in is +* managed itself. +*/ +if (WARN_ON (!devres_find (dev, devm_fpga_mgr_release, + fpga_mgr_devres_match, mgr))) +return -EINVAL ; + + dr =devres_alloc (devm_fpga_mgr_unregister,sizeof (*dr),GFP_KERNEL ); +if (!dr) +return -ENOMEM ; + + ret =fpga_mgr_register (mgr); +if (ret) { +devres_free (dr); +return ret; + } + + dr->mgr = mgr; +devres_add (dev, dr); + +return 0 ; +} +EXPORT_SYMBOL_GPL (devm_fpga_mgr_register); +static void fpga_mgr_dev_release (struct device *dev) { }
include/linux/fpga/fpga-mgr.h +2 -0
@@ -198,6 +198,8 @@ void fpga_mgr_free(struct fpga_manager *mgr);int fpga_mgr_register (struct fpga_manager *mgr);void fpga_mgr_unregister (struct fpga_manager *mgr); +int devm_fpga_mgr_register (struct device *dev,struct fpga_manager *mgr); +struct fpga_manager *devm_fpga_mgr_create (struct device *dev,const char *name,const struct fpga_manager_ops *mops,void *priv);
Signature · 1 line
2.28.0
Re: [PATCH v2 01/10] fpga: fpga-mgr: Add devm_fpga_mgr_register() API
Quoted 149 lines · Moritz Fischer
Add a
devm_fpga_mgr_register()API that can be used to register a FPGA Manager that was created usingdevm_fpga_mgr_create().Introduce a struct
fpga_mgr_devresthat makes the devres allocation a little bit more readable and gets reused fordevm_fpga_mgr_create()devm_fpga_mgr_register().Reviewed-by Tom Rix <[email protected]>Signed-off-by Moritz Fischer <[email protected]>--- drivers/fpga/fpga-mgr.c | 81 +++++++++++++++++++++++++++++------ include/linux/fpga/fpga-mgr.h | 2 + 2 files changed, 71 insertions(+), 12 deletions(-)drivers/fpga/fpga-mgr.c +69
-12@@ -21,6 +21,10 @@static DEFINE_IDA (fpga_mgr_ida);static struct class *fpga_mgr_class; +struct fpga_mgr_devres { +struct fpga_manager *mgr; +}; +/** * fpga_image_info_alloc - Allocate a FPGA image info struct * @dev: owning device @@ -625,9 +629,9 @@ EXPORT_SYMBOL_GPL(fpga_mgr_free);static void devm_fpga_mgr_release (struct device *dev,void *res) { -struct fpga_manager *mgr = *(struct fpga_manager **)res; +struct fpga_mgr_devres *dr = res; -fpga_mgr_free (mgr); +fpga_mgr_free (dr->mgr); }/** @@ -651,21 +655,21 @@ struct fpga_manager *devm_fpga_mgr_create(struct device *dev, const char *name,const struct fpga_manager_ops *mops, void *priv) { - struct fpga_manager **ptr, *mgr; + struct fpga_mgr_devres *dr; - ptr =devres_alloc (devm_fpga_mgr_release,sizeof (*ptr),GFP_KERNEL ); -if (!ptr) + dr =devres_alloc (devm_fpga_mgr_release,sizeof (*dr),GFP_KERNEL ); +if (!dr)return NULL ; - mgr =fpga_mgr_create (dev, name, mops, priv); -if (!mgr) { -devres_free (ptr); - }else { - *ptr = mgr; -devres_add (dev, ptr); + dr->mgr =fpga_mgr_create (dev, name, mops, priv); +if (!dr->mgr) { +devres_free (dr); +return NULL ; } -return mgr; +devres_add (dev, dr); + +return dr->mgr; }EXPORT_SYMBOL_GPL (devm_fpga_mgr_create);@@ -722,6 +726,59 @@ void fpga_mgr_unregister(struct fpga_manager *mgr) }EXPORT_SYMBOL_GPL (fpga_mgr_unregister); +static int fpga_mgr_devres_match (struct device *dev,void *res, +void *match_data) +{ +struct fpga_mgr_devres *dr = res; + +return match_data == dr->mgr; +} + +static void devm_fpga_mgr_unregister (struct device *dev,void *res) +{ +struct fpga_mgr_devres *dr = res; + +fpga_mgr_unregister (dr->mgr); +} + +/** +* devm_fpga_mgr_register - resource managed variant of fpga_mgr_register() +* @dev: managing device for this FPGA manager +* @mgr: fpga manager struct +* +* This is the devres variant of fpga_mgr_register() for which the unregister +* function will be called automatically when the managing device is detached. +*/ +int devm_fpga_mgr_register (struct device *dev,struct fpga_manager *mgr) +{ +struct fpga_mgr_devres *dr; +int ret; + +/* +* Make sure that the struct fpga_manager * that is passed in is +* managed itself. +*/ +if (WARN_ON (!devres_find (dev, devm_fpga_mgr_release, + fpga_mgr_devres_match, mgr))) +return -EINVAL ; + + dr =devres_alloc (devm_fpga_mgr_unregister,sizeof (*dr),GFP_KERNEL ); +if (!dr) +return -ENOMEM ; + + ret =fpga_mgr_register (mgr); +if (ret) { +devres_free (dr); +return ret; + } + + dr->mgr = mgr; +devres_add (dev, dr); + +return 0 ; +} +EXPORT_SYMBOL_GPL (devm_fpga_mgr_register); +static void fpga_mgr_dev_release (struct device *dev) { }include/linux/fpga/fpga-mgr.h +2
-0@@ -198,6 +198,8 @@ void fpga_mgr_free(struct fpga_manager *mgr);int fpga_mgr_register (struct fpga_manager *mgr);void fpga_mgr_unregister (struct fpga_manager *mgr); +int devm_fpga_mgr_register (struct device *dev,struct fpga_manager *mgr); +struct fpga_manager *devm_fpga_mgr_create (struct device *dev,const char *name,const struct fpga_manager_ops *mops,void *priv);Signature · 1 line
2.28.0
Applied series to for-next,
Thanks
Moritz Fischer
maintainerPATCH v2 2/10 fpga: fpga-mgr: altera-ps-spi: Simplify registration
In reply to Moritz FischerSimplify registration by using new devm_fpga_mgr_register() API.
--- drivers/fpga/altera-ps-spi.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/fpga/altera-ps-spi.c +1 -13
@@ -307,18 +307,7 @@ static int altera_ps_probe(struct spi_device *spi)if (!mgr)return -ENOMEM ; -spi_set_drvdata (spi, mgr); - -return fpga_mgr_register (mgr); -} - -static int altera_ps_remove (struct spi_device *spi) -{ -struct fpga_manager *mgr =spi_get_drvdata (spi); - -fpga_mgr_unregister (mgr); - -return 0 ; +return devm_fpga_mgr_register (&spi->dev, mgr); }static const struct spi_device_id altera_ps_spi_ids[] = {
@@ -337,7 +326,6 @@ static struct spi_driver altera_ps_driver = { }, .id_table = altera_ps_spi_ids, .probe = altera_ps_probe, - .remove = altera_ps_remove, };module_spi_driver (altera_ps_driver)
Signature · 1 line
2.28.0
Moritz Fischer
maintainerPATCH v2 3/10 fpga: fpga-mgr: dfl-fme-mgr: Simplify registration
In reply to Moritz FischerSimplify registration using new devm_fpga_mgr_register() API.
--- drivers/fpga/dfl-fme-mgr.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/fpga/dfl-fme-mgr.c +1 -12
@@ -314,18 +314,8 @@ static int fme_mgr_probe(struct platform_device *pdev)return -ENOMEM ; mgr->compat_id = compat_id; -platform_set_drvdata (pdev, mgr); -return fpga_mgr_register (mgr); -} - -static int fme_mgr_remove (struct platform_device *pdev) -{ -struct fpga_manager *mgr =platform_get_drvdata (pdev); - -fpga_mgr_unregister (mgr); - -return 0 ; +return devm_fpga_mgr_register (dev, mgr); }static struct platform_driver fme_mgr_driver = {
@@ -333,7 +323,6 @@ static struct platform_driver fme_mgr_driver = { .name = DFL_FPGA_FME_MGR, }, .probe = fme_mgr_probe, - .remove = fme_mgr_remove, };module_platform_driver (fme_mgr_driver);
Signature · 1 line
2.28.0
Moritz Fischer
maintainerPATCH v2 4/10 fpga: fpga-mgr: ice40-spi: Simplify registration
In reply to Moritz FischerSimplify registration using new devm_fpga_mgr_register() API.
--- drivers/fpga/ice40-spi.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/fpga/ice40-spi.c +1 -13
@@ -183,18 +183,7 @@ static int ice40_fpga_probe(struct spi_device *spi)if (!mgr)return -ENOMEM ; -spi_set_drvdata (spi, mgr); - -return fpga_mgr_register (mgr); -} - -static int ice40_fpga_remove (struct spi_device *spi) -{ -struct fpga_manager *mgr =spi_get_drvdata (spi); - -fpga_mgr_unregister (mgr); - -return 0 ; +return devm_fpga_mgr_register (dev, mgr); }static const struct of_device_id ice40_fpga_of_match[] = {
@@ -205,7 +194,6 @@ MODULE_DEVICE_TABLE(of, ice40_fpga_of_match);static struct spi_driver ice40_fpga_driver = { .probe = ice40_fpga_probe, - .remove = ice40_fpga_remove, .driver = { .name ="ice40spi" , .of_match_table =of_match_ptr (ice40_fpga_of_match),
Signature · 1 line
2.28.0
Moritz Fischer
maintainerPATCH v2 5/10 fpga: fpga-mgr: machxo2-spi: Simplify registration
In reply to Moritz FischerSimplify registration using new devm_fpga_mgr_register() API.
--- drivers/fpga/machxo2-spi.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/fpga/machxo2-spi.c +1 -13
@@ -371,18 +371,7 @@ static int machxo2_spi_probe(struct spi_device *spi)if (!mgr)return -ENOMEM ; -spi_set_drvdata (spi, mgr); - -return fpga_mgr_register (mgr); -} - -static int machxo2_spi_remove (struct spi_device *spi) -{ -struct fpga_manager *mgr =spi_get_drvdata (spi); - -fpga_mgr_unregister (mgr); - -return 0 ; +return devm_fpga_mgr_register (dev, mgr); }static const struct of_device_id of_match[] = {
@@ -403,7 +392,6 @@ static struct spi_driver machxo2_spi_driver = { .of_match_table = of_match_ptr(of_match), }, .probe = machxo2_spi_probe, - .remove = machxo2_spi_remove, .id_table = lattice_ids, };
Signature · 1 line
2.28.0
Moritz Fischer
maintainerPATCH v2 6/10 fpga: fpga-mgr: socfpga: Simplify registration
In reply to Moritz FischerSimplify registration using new devm_fpga_mgr_register() API.
--- drivers/fpga/socfpga.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/fpga/socfpga.c +1 -13
@@ -576,18 +576,7 @@ static int socfpga_fpga_probe(struct platform_device *pdev)if (!mgr)return -ENOMEM ; -platform_set_drvdata (pdev, mgr); - -return fpga_mgr_register (mgr); -} - -static int socfpga_fpga_remove (struct platform_device *pdev) -{ -struct fpga_manager *mgr =platform_get_drvdata (pdev); - -fpga_mgr_unregister (mgr); - -return 0 ; +return devm_fpga_mgr_register (dev, mgr); }#ifdef CONFIG_OF
@@ -601,7 +590,6 @@ MODULE_DEVICE_TABLE(of, socfpga_fpga_of_match);static struct platform_driver socfpga_fpga_driver = { .probe = socfpga_fpga_probe, - .remove = socfpga_fpga_remove, .driver = { .name ="socfpga_fpga_manager" , .of_match_table =of_match_ptr (socfpga_fpga_of_match),
Signature · 1 line
2.28.0
Moritz Fischer
maintainerPATCH v2 7/10 fpga: fpga-mgr: ts73xx: Simplify registration
In reply to Moritz FischerSimplify registration using new devm_fpga_mgr_register() API.
--- drivers/fpga/ts73xx-fpga.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/fpga/ts73xx-fpga.c +1 -13
@@ -127,18 +127,7 @@ static int ts73xx_fpga_probe(struct platform_device *pdev)if (!mgr)return -ENOMEM ; -platform_set_drvdata (pdev, mgr); - -return fpga_mgr_register (mgr); -} - -static int ts73xx_fpga_remove (struct platform_device *pdev) -{ -struct fpga_manager *mgr =platform_get_drvdata (pdev); - -fpga_mgr_unregister (mgr); - -return 0 ; +return devm_fpga_mgr_register (kdev, mgr); }static struct platform_driver ts73xx_fpga_driver = {
@@ -146,7 +135,6 @@ static struct platform_driver ts73xx_fpga_driver = { .name = "ts73xx-fpga-mgr", }, .probe = ts73xx_fpga_probe, - .remove = ts73xx_fpga_remove, };module_platform_driver (ts73xx_fpga_driver);
Signature · 1 line
2.28.0
Moritz Fischer
maintainerPATCH v2 8/10 fpga: fpga-mgr: xilinx-spi: Simplify registration
In reply to Moritz FischerSimplify registration using new devm_fpga_mgr_register() API.
--- drivers/fpga/xilinx-spi.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/fpga/xilinx-spi.c +1 -13
@@ -259,18 +259,7 @@ static int xilinx_spi_probe(struct spi_device *spi)if (!mgr)return -ENOMEM ; -spi_set_drvdata (spi, mgr); - -return fpga_mgr_register (mgr); -} - -static int xilinx_spi_remove (struct spi_device *spi) -{ -struct fpga_manager *mgr =spi_get_drvdata (spi); - -fpga_mgr_unregister (mgr); - -return 0 ; +return devm_fpga_mgr_register (&spi->dev, mgr); }static const struct of_device_id xlnx_spi_of_match[] = {
@@ -285,7 +274,6 @@ static struct spi_driver xilinx_slave_spi_driver = { .of_match_table = of_match_ptr(xlnx_spi_of_match), }, .probe = xilinx_spi_probe, - .remove = xilinx_spi_remove, };module_spi_driver (xilinx_slave_spi_driver)
Signature · 1 line
2.28.0
Moritz Fischer
maintainerPATCH v2 9/10 fpga: fpga-mgr: zynqmp: Simplify registration
In reply to Moritz FischerSimplify registration using new devm_fpga_mgr_register() API.
--- drivers/fpga/zynqmp-fpga.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-)
drivers/fpga/zynqmp-fpga.c +1 -20
@@ -95,7 +95,6 @@ static int zynqmp_fpga_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct zynqmp_fpga_priv *priv;struct fpga_manager *mgr; -int ret; priv =devm_kzalloc (dev,sizeof (*priv),GFP_KERNEL );if (!priv)
@@ -108,24 +107,7 @@ static int zynqmp_fpga_probe(struct platform_device *pdev)if (!mgr)return -ENOMEM ; -platform_set_drvdata (pdev, mgr); - - ret =fpga_mgr_register (mgr); -if (ret) { -dev_err (dev,"unable to register FPGA manager" ); -return ret; - } - -return 0 ; -} - -static int zynqmp_fpga_remove (struct platform_device *pdev) -{ -struct fpga_manager *mgr =platform_get_drvdata (pdev); - -fpga_mgr_unregister (mgr); - -return 0 ; +return devm_fpga_mgr_register (dev, mgr); }static const struct of_device_id zynqmp_fpga_of_match[] = {
@@ -137,7 +119,6 @@ MODULE_DEVICE_TABLE(of, zynqmp_fpga_of_match);static struct platform_driver zynqmp_fpga_driver = { .probe = zynqmp_fpga_probe, - .remove = zynqmp_fpga_remove, .driver = { .name ="zynqmp_fpga_manager" , .of_match_table =of_match_ptr (zynqmp_fpga_of_match),
Signature · 1 line
2.28.0
Moritz Fischer
maintainerPATCH v2 10/10 fpga: fpga-mgr: altera-pr-ip: Simplify registration
In reply to Moritz FischerSimplify registration using new devm_fpga_mgr_register() API.
---
Changes from v1:
- Removed part that removes unused symbol
--- drivers/fpga/altera-pr-ip-core-plat.c | 10 ---------- drivers/fpga/altera-pr-ip-core.c | 4 +--- 2 files changed, 1 insertion(+), 13 deletions(-)
drivers/fpga/altera-pr-ip-core-plat.c +0 -10
@@ -28,15 +28,6 @@ static int alt_pr_platform_probe(struct platform_device *pdev)return alt_pr_register (dev, reg_base); } -static int alt_pr_platform_remove (struct platform_device *pdev) -{ -struct device *dev = &pdev->dev; - -alt_pr_unregister (dev); - -return 0 ; -} -static const struct of_device_id alt_pr_of_match[] = { { .compatible ="altr,a10-pr-ip" , }, {},
@@ -46,7 +37,6 @@ MODULE_DEVICE_TABLE(of, alt_pr_of_match);static struct platform_driver alt_pr_platform_driver = { .probe = alt_pr_platform_probe, - .remove = alt_pr_platform_remove, .driver = { .name ="alt_a10_pr_ip" , .of_match_table = alt_pr_of_match,
drivers/fpga/altera-pr-ip-core.c +1 -3
@@ -195,9 +195,7 @@ int alt_pr_register(struct device *dev, void __iomem *reg_base)if (!mgr)return -ENOMEM ; -dev_set_drvdata (dev, mgr); - -return fpga_mgr_register (mgr); +return devm_fpga_mgr_register (dev, mgr); }EXPORT_SYMBOL_GPL (alt_pr_register);
Signature · 1 line
2.28.0
Re: [PATCH v2 10/10] fpga: fpga-mgr: altera-pr-ip: Simplify registration
Quoted 1 line · Moritz Fischer
Simplify registration using new
devm_fpga_mgr_register()API.
Should change old commit message to something about removing symbol
alt_pr_platform_remove
Otherwise fine.
Quoted 55 lines
Signed-off-by Moritz Fischer <[email protected]>---
Changes from v1:
- Removed part that removes unused symbol--- drivers/fpga/altera-pr-ip-core-plat.c | 10 ---------- drivers/fpga/altera-pr-ip-core.c | 4 +--- 2 files changed, 1 insertion(+), 13 deletions(-)drivers/fpga/altera-pr-ip-core-plat.c +0
-10@@ -28,15 +28,6 @@ static int alt_pr_platform_probe(struct platform_device *pdev)return alt_pr_register (dev, reg_base); } -static int alt_pr_platform_remove (struct platform_device *pdev) -{ -struct device *dev = &pdev->dev; - -alt_pr_unregister (dev); - -return 0 ; -} -static const struct of_device_id alt_pr_of_match[] = { { .compatible ="altr,a10-pr-ip" , }, {},@@ -46,7 +37,6 @@ MODULE_DEVICE_TABLE(of, alt_pr_of_match);static struct platform_driver alt_pr_platform_driver = { .probe = alt_pr_platform_probe, - .remove = alt_pr_platform_remove, .driver = { .name ="alt_a10_pr_ip" , .of_match_table = alt_pr_of_match,drivers/fpga/altera-pr-ip-core.c +1
-3@@ -195,9 +195,7 @@ int alt_pr_register(struct device *dev, void __iomem *reg_base)if (!mgr)return -ENOMEM ; -dev_set_drvdata (dev, mgr); - -return fpga_mgr_register (mgr); +return devm_fpga_mgr_register (dev, mgr); }EXPORT_SYMBOL_GPL (alt_pr_register);