Skip to content

Commit 9519793

Browse files
Uwe Kleine-Königandersson
authored andcommitted
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>
1 parent 4cf16b6 commit 9519793

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/hwspinlock/u8500_hsem.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,18 @@ static int u8500_hsem_probe(struct platform_device *pdev)
120120
pdata->base_id, num_locks);
121121
}
122122

123-
static int u8500_hsem_remove(struct platform_device *pdev)
123+
static void u8500_hsem_remove(struct platform_device *pdev)
124124
{
125125
struct hwspinlock_device *bank = platform_get_drvdata(pdev);
126126
void __iomem *io_base = bank->lock[0].priv - HSEM_REGISTER_OFFSET;
127127

128128
/* clear all interrupts */
129129
writel(0xFFFF, io_base + HSEM_ICRALL);
130-
131-
return 0;
132130
}
133131

134132
static struct platform_driver u8500_hsem_driver = {
135133
.probe = u8500_hsem_probe,
136-
.remove = u8500_hsem_remove,
134+
.remove_new = u8500_hsem_remove,
137135
.driver = {
138136
.name = "u8500_hsem",
139137
},

0 commit comments

Comments
 (0)