diff options
| author | Alan Tull <[email protected]> | 2018-10-15 22:20:01 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2018-10-16 09:13:50 +0000 |
| commit | 084181fe8cc7472695b907f0018f4cd00934cb12 (patch) | |
| tree | 812b6c10de92d91bccfdec2da621abacc2745c4d /drivers/fpga/altera-ps-spi.c | |
| parent | hv_balloon: Replace spin_is_locked() with lockdep (diff) | |
| download | kernel-084181fe8cc7472695b907f0018f4cd00934cb12.tar.gz kernel-084181fe8cc7472695b907f0018f4cd00934cb12.zip | |
fpga: mgr: add devm_fpga_mgr_create
Add devm_fpga_mgr_create() which is the managed
version of fpga_mgr_create().
Change current FPGA manager drivers to use
devm_fpga_mgr_create()
Signed-off-by: Alan Tull <[email protected]>
Suggested-by: Federico Vaga <[email protected]>
Acked-by: Moritz Fischer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/fpga/altera-ps-spi.c')
| -rw-r--r-- | drivers/fpga/altera-ps-spi.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/fpga/altera-ps-spi.c b/drivers/fpga/altera-ps-spi.c index 24b25c626036..33aafda50af5 100644 --- a/drivers/fpga/altera-ps-spi.c +++ b/drivers/fpga/altera-ps-spi.c @@ -239,7 +239,6 @@ static int altera_ps_probe(struct spi_device *spi) struct altera_ps_conf *conf; const struct of_device_id *of_id; struct fpga_manager *mgr; - int ret; conf = devm_kzalloc(&spi->dev, sizeof(*conf), GFP_KERNEL); if (!conf) @@ -275,18 +274,14 @@ static int altera_ps_probe(struct spi_device *spi) snprintf(conf->mgr_name, sizeof(conf->mgr_name), "%s %s", dev_driver_string(&spi->dev), dev_name(&spi->dev)); - mgr = fpga_mgr_create(&spi->dev, conf->mgr_name, - &altera_ps_ops, conf); + mgr = devm_fpga_mgr_create(&spi->dev, conf->mgr_name, + &altera_ps_ops, conf); if (!mgr) return -ENOMEM; spi_set_drvdata(spi, mgr); - ret = fpga_mgr_register(mgr); - if (ret) - fpga_mgr_free(mgr); - - return ret; + return fpga_mgr_register(mgr); } static int altera_ps_remove(struct spi_device *spi) |
