mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-07 14:32:23 +00:00
char: xilinx_hwicap: 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() is 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> Acked-by: Michal Simek <michal.simek@amd.com> Message-ID: <20230605092047.50472-3-u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3d82dca0f2
commit
74a81c4854
@ -804,7 +804,7 @@ static int hwicap_drv_probe(struct platform_device *pdev)
|
||||
&buffer_icap_config, regs);
|
||||
}
|
||||
|
||||
static int hwicap_drv_remove(struct platform_device *pdev)
|
||||
static void hwicap_drv_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct hwicap_drvdata *drvdata;
|
||||
@ -820,8 +820,6 @@ static int hwicap_drv_remove(struct platform_device *pdev)
|
||||
mutex_lock(&icap_sem);
|
||||
probed_devices[MINOR(dev->devt)-XHWICAP_MINOR] = 0;
|
||||
mutex_unlock(&icap_sem);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
@ -838,7 +836,7 @@ MODULE_DEVICE_TABLE(of, hwicap_of_match);
|
||||
|
||||
static struct platform_driver hwicap_platform_driver = {
|
||||
.probe = hwicap_drv_probe,
|
||||
.remove = hwicap_drv_remove,
|
||||
.remove_new = hwicap_drv_remove,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.of_match_table = hwicap_of_match,
|
||||
|
Loading…
Reference in New Issue
Block a user