mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-03 17:40:04 +00:00
bus: fsl-mc: fsl-mc-allocator: Drop if block with always wrong condition
If fsl_mc_is_allocatable(mc_dev) evaluates to false, the driver won't have bound to that device and then fsl_mc_allocator_remove() is never called for that device. fsl_mc_allocator_remove() is the only caller of fsl_mc_resource_pool_remove_device(), so the same check can be removed from there. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com> Tested-by: Ioana Ciornei <ioana.ciornei@nxp.com> # sanity checks Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Tested-by: Laurentiu Tudor <laurentiu.tudor@nxp.com> Signed-off-by: Li Yang <leoyang.li@nxp.com>
This commit is contained in:
parent
f8fce83183
commit
e0ac89361c
1 changed files with 0 additions and 6 deletions
|
@ -103,9 +103,6 @@ static int __must_check fsl_mc_resource_pool_remove_device(struct fsl_mc_device
|
|||
struct fsl_mc_resource *resource;
|
||||
int error = -EINVAL;
|
||||
|
||||
if (!fsl_mc_is_allocatable(mc_dev))
|
||||
goto out;
|
||||
|
||||
resource = mc_dev->resource;
|
||||
if (!resource || resource->data != mc_dev)
|
||||
goto out;
|
||||
|
@ -613,9 +610,6 @@ static int fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev)
|
|||
{
|
||||
int error;
|
||||
|
||||
if (!fsl_mc_is_allocatable(mc_dev))
|
||||
return -EINVAL;
|
||||
|
||||
if (mc_dev->resource) {
|
||||
error = fsl_mc_resource_pool_remove_device(mc_dev);
|
||||
if (error < 0)
|
||||
|
|
Loading…
Reference in a new issue