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

media: microchip-sama7g5-isc: 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
447728bd 61263f17

+2 -4
+2 -4
drivers/media/platform/microchip/microchip-sama7g5-isc.c
··· 577 577 return ret; 578 578 } 579 579 580 - static int microchip_xisc_remove(struct platform_device *pdev) 580 + static void microchip_xisc_remove(struct platform_device *pdev) 581 581 { 582 582 struct isc_device *isc = platform_get_drvdata(pdev); 583 583 ··· 592 592 clk_disable_unprepare(isc->hclock); 593 593 594 594 microchip_isc_clk_cleanup(isc); 595 - 596 - return 0; 597 595 } 598 596 599 597 static int __maybe_unused xisc_runtime_suspend(struct device *dev) ··· 629 631 630 632 static struct platform_driver microchip_xisc_driver = { 631 633 .probe = microchip_xisc_probe, 632 - .remove = microchip_xisc_remove, 634 + .remove_new = microchip_xisc_remove, 633 635 .driver = { 634 636 .name = "microchip-sama7g5-xisc", 635 637 .pm = &microchip_xisc_dev_pm_ops,