Skip to content

Commit e0ac893

Browse files
Uwe Kleine-KönigLi Yang
authored andcommitted
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>
1 parent f8fce83 commit e0ac893

1 file changed

Lines changed: 0 additions & 6 deletions

File tree

drivers/bus/fsl-mc/fsl-mc-allocator.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ static int __must_check fsl_mc_resource_pool_remove_device(struct fsl_mc_device
103103
struct fsl_mc_resource *resource;
104104
int error = -EINVAL;
105105

106-
if (!fsl_mc_is_allocatable(mc_dev))
107-
goto out;
108-
109106
resource = mc_dev->resource;
110107
if (!resource || resource->data != mc_dev)
111108
goto out;
@@ -613,9 +610,6 @@ static int fsl_mc_allocator_remove(struct fsl_mc_device *mc_dev)
613610
{
614611
int error;
615612

616-
if (!fsl_mc_is_allocatable(mc_dev))
617-
return -EINVAL;
618-
619613
if (mc_dev->resource) {
620614
error = fsl_mc_resource_pool_remove_device(mc_dev);
621615
if (error < 0)

0 commit comments

Comments
 (0)