mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-24 11:25:43 +00:00
media: ti: j721e-csi2rx: 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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
1f715c09e8
commit
8796f3357f
1 changed files with 2 additions and 4 deletions
|
@ -1142,7 +1142,7 @@ static int ti_csi2rx_probe(struct platform_device *pdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ti_csi2rx_remove(struct platform_device *pdev)
|
static void ti_csi2rx_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct ti_csi2rx_dev *csi = platform_get_drvdata(pdev);
|
struct ti_csi2rx_dev *csi = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
|
@ -1154,8 +1154,6 @@ static int ti_csi2rx_remove(struct platform_device *pdev)
|
||||||
ti_csi2rx_cleanup_dma(csi);
|
ti_csi2rx_cleanup_dma(csi);
|
||||||
|
|
||||||
mutex_destroy(&csi->mutex);
|
mutex_destroy(&csi->mutex);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct of_device_id ti_csi2rx_of_match[] = {
|
static const struct of_device_id ti_csi2rx_of_match[] = {
|
||||||
|
@ -1166,7 +1164,7 @@ MODULE_DEVICE_TABLE(of, ti_csi2rx_of_match);
|
||||||
|
|
||||||
static struct platform_driver ti_csi2rx_pdrv = {
|
static struct platform_driver ti_csi2rx_pdrv = {
|
||||||
.probe = ti_csi2rx_probe,
|
.probe = ti_csi2rx_probe,
|
||||||
.remove = ti_csi2rx_remove,
|
.remove_new = ti_csi2rx_remove,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = TI_CSI2RX_MODULE_NAME,
|
.name = TI_CSI2RX_MODULE_NAME,
|
||||||
.of_match_table = ti_csi2rx_of_match,
|
.of_match_table = ti_csi2rx_of_match,
|
||||||
|
|
Loading…
Reference in a new issue