diff options
author | Laurentiu Tudor <laurentiu.tudor@nxp.com> | 2017-02-07 09:43:47 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-09 13:26:01 +0100 |
commit | dc341c4ec2bf7c122f818f881eb2a1d5d6e8e9c9 (patch) | |
tree | 92b6051a6cd2fc5f0d42d925547da43d53a0fb6d /drivers/staging/fsl-mc | |
parent | 95b3523b723e5354a375f4d185c74970322c7bf5 (diff) | |
download | blackbird-op-linux-dc341c4ec2bf7c122f818f881eb2a1d5d6e8e9c9.tar.gz blackbird-op-linux-dc341c4ec2bf7c122f818f881eb2a1d5d6e8e9c9.zip |
staging: fsl-mc: don't use devres api for refcounted objects
Mixing two memory management systems, in this case
managed device resource api and refcounted objects
is a bad idea. Lifetime of an object is controlled
by its refcount so allocating it with other apis
that have their own lifetime control is not ok.
Drop devm_*() apis in favor of plain allocations.
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fsl-mc')
-rw-r--r-- | drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c index 5963e98cc558..f3106874c1a3 100644 --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c @@ -430,7 +430,7 @@ static void fsl_mc_device_release(struct device *dev) mc_bus = to_fsl_mc_bus(mc_dev); if (mc_bus) - devm_kfree(mc_dev->dev.parent, mc_bus); + kfree(mc_bus); else kmem_cache_free(mc_dev_cache, mc_dev); } @@ -457,7 +457,7 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, /* * Allocate an MC bus device object: */ - mc_bus = devm_kzalloc(parent_dev, sizeof(*mc_bus), GFP_KERNEL); + mc_bus = kzalloc(sizeof(*mc_bus), GFP_KERNEL); if (!mc_bus) return -ENOMEM; @@ -562,7 +562,7 @@ int fsl_mc_device_add(struct dprc_obj_desc *obj_desc, error_cleanup_dev: kfree(mc_dev->regions); if (mc_bus) - devm_kfree(parent_dev, mc_bus); + kfree(mc_bus); else kmem_cache_free(mc_dev_cache, mc_dev); |