Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: stih-cec: 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 (mostly) ignored
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.

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>

authored by

Uwe Kleine-König and committed by
Hans Verkuil
3cdae5bf ba878eda

+2 -4
+2 -4
drivers/media/cec/platform/sti/stih-cec.c
··· 364 364 return ret; 365 365 } 366 366 367 - static int stih_cec_remove(struct platform_device *pdev) 367 + static void stih_cec_remove(struct platform_device *pdev) 368 368 { 369 369 struct stih_cec *cec = platform_get_drvdata(pdev); 370 370 371 371 cec_notifier_cec_adap_unregister(cec->notifier, cec->adap); 372 372 cec_unregister_adapter(cec->adap); 373 - 374 - return 0; 375 373 } 376 374 377 375 static const struct of_device_id stih_cec_match[] = { ··· 382 384 383 385 static struct platform_driver stih_cec_pdrv = { 384 386 .probe = stih_cec_probe, 385 - .remove = stih_cec_remove, 387 + .remove_new = stih_cec_remove, 386 388 .driver = { 387 389 .name = CEC_NAME, 388 390 .of_match_table = stih_cec_match,