hwspinlock: u8500: 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>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230314180241.2865888-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
Uwe Kleine-König 2023-03-14 19:02:41 +01:00 committed by Bjorn Andersson
parent 4cf16b6b74
commit 9519793bb6

View File

@ -120,20 +120,18 @@ static int u8500_hsem_probe(struct platform_device *pdev)
pdata->base_id, num_locks); pdata->base_id, num_locks);
} }
static int u8500_hsem_remove(struct platform_device *pdev) static void u8500_hsem_remove(struct platform_device *pdev)
{ {
struct hwspinlock_device *bank = platform_get_drvdata(pdev); struct hwspinlock_device *bank = platform_get_drvdata(pdev);
void __iomem *io_base = bank->lock[0].priv - HSEM_REGISTER_OFFSET; void __iomem *io_base = bank->lock[0].priv - HSEM_REGISTER_OFFSET;
/* clear all interrupts */ /* clear all interrupts */
writel(0xFFFF, io_base + HSEM_ICRALL); writel(0xFFFF, io_base + HSEM_ICRALL);
return 0;
} }
static struct platform_driver u8500_hsem_driver = { static struct platform_driver u8500_hsem_driver = {
.probe = u8500_hsem_probe, .probe = u8500_hsem_probe,
.remove = u8500_hsem_remove, .remove_new = u8500_hsem_remove,
.driver = { .driver = {
.name = "u8500_hsem", .name = "u8500_hsem",
}, },