mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
powerpc: fsl_msi: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/42d8e3721053dce21ea373a24cb37fb0f59eed26.1708529736.git.u.kleine-koenig@pengutronix.de
This commit is contained in:
parent
18a4a2612b
commit
e2064de2f3
@ -320,7 +320,7 @@ static irqreturn_t fsl_msi_cascade(int irq, void *data)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int fsl_of_msi_remove(struct platform_device *ofdev)
|
||||
static void fsl_of_msi_remove(struct platform_device *ofdev)
|
||||
{
|
||||
struct fsl_msi *msi = platform_get_drvdata(ofdev);
|
||||
int virq, i;
|
||||
@ -343,8 +343,6 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)
|
||||
if ((msi->feature & FSL_PIC_IP_MASK) != FSL_PIC_IP_VMPIC)
|
||||
iounmap(msi->msi_regs);
|
||||
kfree(msi);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct lock_class_key fsl_msi_irq_class;
|
||||
@ -603,7 +601,7 @@ static struct platform_driver fsl_of_msi_driver = {
|
||||
.of_match_table = fsl_of_msi_ids,
|
||||
},
|
||||
.probe = fsl_of_msi_probe,
|
||||
.remove = fsl_of_msi_remove,
|
||||
.remove_new = fsl_of_msi_remove,
|
||||
};
|
||||
|
||||
static __init int fsl_of_msi_init(void)
|
||||
|
Loading…
Reference in New Issue
Block a user