Skip to content

Commit 8796f33

Browse files
Uwe Kleine-KönigHans Verkuil
authored andcommitted
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 <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 1f715c0 commit 8796f33

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ static int ti_csi2rx_probe(struct platform_device *pdev)
11421142
return ret;
11431143
}
11441144

1145-
static int ti_csi2rx_remove(struct platform_device *pdev)
1145+
static void ti_csi2rx_remove(struct platform_device *pdev)
11461146
{
11471147
struct ti_csi2rx_dev *csi = platform_get_drvdata(pdev);
11481148

@@ -1154,8 +1154,6 @@ static int ti_csi2rx_remove(struct platform_device *pdev)
11541154
ti_csi2rx_cleanup_dma(csi);
11551155

11561156
mutex_destroy(&csi->mutex);
1157-
1158-
return 0;
11591157
}
11601158

11611159
static const struct of_device_id ti_csi2rx_of_match[] = {
@@ -1166,7 +1164,7 @@ MODULE_DEVICE_TABLE(of, ti_csi2rx_of_match);
11661164

11671165
static struct platform_driver ti_csi2rx_pdrv = {
11681166
.probe = ti_csi2rx_probe,
1169-
.remove = ti_csi2rx_remove,
1167+
.remove_new = ti_csi2rx_remove,
11701168
.driver = {
11711169
.name = TI_CSI2RX_MODULE_NAME,
11721170
.of_match_table = ti_csi2rx_of_match,

0 commit comments

Comments
 (0)