[1/2] bus: fsl-mc: Drop if block with always false condition

Message ID 20231103230001.3652259-3-u.kleine-koenig@pengutronix.de
State New
Headers
Series [1/2] bus: fsl-mc: Drop if block with always false condition |

Commit Message

Uwe Kleine-König Nov. 3, 2023, 11 p.m. UTC
  The mc that belongs to a pdev is always a root dprc. In
fsl_mc_bus_probe() the mc device gets assigned the platform device as
parent. As dev_is_fsl_mc() is false for a platform device,
fsl_mc_get_root_dprc() will always be true and so the if body is never
run and it can be dropped.

The motivation for this change is to get rid of an error path in
.remove() that is broken (because only a part of the necessary cleanup
is done resulting in leaks and/or use-after-frees and the driver core
ignores the return value of .remove().)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/bus/fsl-mc/fsl-mc-bus.c | 3 ---
 1 file changed, 3 deletions(-)


base-commit: e27090b1413ff236ca1aec26d6b022149115de2c
  

Comments

Uwe Kleine-König Nov. 5, 2023, 2:31 p.m. UTC | #1
Hello,

I just noticed a double space in the Subject line. Feel free to replace
it by a single one when applying. (I assume I shouldn't resend just for
that, tell me if you prefer that though.)

Best regards
Uwe
  
Uwe Kleine-König Nov. 28, 2023, 5:03 p.m. UTC | #2
Hello,

On Sun, Nov 05, 2023 at 03:31:46PM +0100, Uwe Kleine-König wrote:
> I just noticed a double space in the Subject line. Feel free to replace
> it by a single one when applying. (I assume I shouldn't resend just for
> that, tell me if you prefer that though.)

Gentle ping. Is this patch set still waiting for review in someone's
mailbox, or did it fell through the cracks already?

Best regards
Uwe
  
Uwe Kleine-König Dec. 4, 2023, 5:10 p.m. UTC | #3
Hello,

On Tue, Nov 28, 2023 at 06:03:10PM +0100, Uwe Kleine-König wrote:
> On Sun, Nov 05, 2023 at 03:31:46PM +0100, Uwe Kleine-König wrote:
> > I just noticed a double space in the Subject line. Feel free to replace
> > it by a single one when applying. (I assume I shouldn't resend just for
> > that, tell me if you prefer that though.)
> 
> Gentle ping. Is this patch set still waiting for review in someone's
> mailbox, or did it fell through the cracks already?

For the record: These two patches are included in a pull request to Arnd
(https://lore.kernel.org/all/20231128174927.m46dgp4juig2omci@pengutronix.de/)
for all of drivers/bus.

Best regards
Uwe
  

Patch

diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index 2f6d5002e43d..75a8d365ffd4 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -1172,9 +1172,6 @@  static int fsl_mc_bus_remove(struct platform_device *pdev)
 	struct fsl_mc *mc = platform_get_drvdata(pdev);
 	struct fsl_mc_io *mc_io;
 
-	if (!fsl_mc_is_root_dprc(&mc->root_mc_bus_dev->dev))
-		return -EINVAL;
-
 	mc_io = mc->root_mc_bus_dev->mc_io;
 	fsl_mc_device_remove(mc->root_mc_bus_dev);
 	fsl_destroy_mc_io(mc_io);