Skip to content

Commit f8fce83

Browse files
Uwe Kleine-KönigLi Yang
authored andcommitted
bus: fsl-mc: dprc: Push down error message from fsl_mc_driver_remove()
The error message emitted in fsl_mc_driver_remove() is very generic. Replace it by a message that mentions the reason for the failure. Returning zero instead of a negative value has no side effect apart from suppressing the generic error message. The first if condition in dprc_remove() can never be true, as this would prevent successful probing of the device and then .remove wasn't called. So this can just be dropped. 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 b816b94 commit f8fce83

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/bus/fsl-mc/dprc-driver.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -839,11 +839,10 @@ static int dprc_remove(struct fsl_mc_device *mc_dev)
839839
{
840840
struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_dev);
841841

842-
if (!is_fsl_mc_bus_dprc(mc_dev))
843-
return -EINVAL;
844-
845-
if (!mc_bus->irq_resources)
846-
return -EINVAL;
842+
if (!mc_bus->irq_resources) {
843+
dev_err(&mc_dev->dev, "No irq resources, so unbinding the device failed\n");
844+
return 0;
845+
}
847846

848847
if (dev_get_msi_domain(&mc_dev->dev))
849848
dprc_teardown_irq(mc_dev);

0 commit comments

Comments
 (0)