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 <atull@kernel.org> Suggested-by: Federico Vaga <federico.vaga@cern.ch> Acked-by: Moritz Fischer <mdf@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
1c87dc897b
commit
084181fe8c
@@ -287,7 +287,6 @@ static int fme_mgr_probe(struct platform_device *pdev)
|
||||
struct fme_mgr_priv *priv;
|
||||
struct fpga_manager *mgr;
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
@@ -309,19 +308,15 @@ static int fme_mgr_probe(struct platform_device *pdev)
|
||||
|
||||
fme_mgr_get_compat_id(priv->ioaddr, compat_id);
|
||||
|
||||
mgr = fpga_mgr_create(dev, "DFL FME FPGA Manager",
|
||||
&fme_mgr_ops, priv);
|
||||
mgr = devm_fpga_mgr_create(dev, "DFL FME FPGA Manager",
|
||||
&fme_mgr_ops, priv);
|
||||
if (!mgr)
|
||||
return -ENOMEM;
|
||||
|
||||
mgr->compat_id = compat_id;
|
||||
platform_set_drvdata(pdev, mgr);
|
||||
|
||||
ret = fpga_mgr_register(mgr);
|
||||
if (ret)
|
||||
fpga_mgr_free(mgr);
|
||||
|
||||
return ret;
|
||||
return fpga_mgr_register(mgr);
|
||||
}
|
||||
|
||||
static int fme_mgr_remove(struct platform_device *pdev)
|
||||
|
Reference in New Issue
Block a user