Skip to content

Commit 86e9f00

Browse files
committed
platform/x86: dell: dell-smo8800: Convert to platform remove callback returning void
JIRA: https://issues.redhat.com/browse/RHEL-47426 commit bb9d621 Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Date: Thu Mar 2 15:47:13 2023 +0100 platform/x86: dell: dell-smo8800: 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: Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/20230302144732.1903781-11-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: David Arcari <darcari@redhat.com>
1 parent e1ad3a0 commit 86e9f00

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/platform/x86/dell/dell-smo8800.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,13 @@ static int smo8800_probe(struct platform_device *device)
154154
return err;
155155
}
156156

157-
static int smo8800_remove(struct platform_device *device)
157+
static void smo8800_remove(struct platform_device *device)
158158
{
159159
struct smo8800_device *smo8800 = platform_get_drvdata(device);
160160

161161
free_irq(smo8800->irq, smo8800);
162162
misc_deregister(&smo8800->miscdev);
163163
dev_dbg(&device->dev, "device /dev/freefall unregistered\n");
164-
return 0;
165164
}
166165

167166
/* NOTE: Keep this list in sync with drivers/i2c/busses/i2c-i801.c */
@@ -180,7 +179,7 @@ MODULE_DEVICE_TABLE(acpi, smo8800_ids);
180179

181180
static struct platform_driver smo8800_driver = {
182181
.probe = smo8800_probe,
183-
.remove = smo8800_remove,
182+
.remove_new = smo8800_remove,
184183
.driver = {
185184
.name = DRIVER_NAME,
186185
.acpi_match_table = smo8800_ids,

0 commit comments

Comments
 (0)