Skip to content

Commit 2efbac8

Browse files
Uwe Kleine-KönigVudentz
authored andcommitted
Bluetooth: hci_intel: 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() will be 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 <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 536a0ad commit 2efbac8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/bluetooth/hci_intel.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ static int intel_probe(struct platform_device *pdev)
11901190
return 0;
11911191
}
11921192

1193-
static int intel_remove(struct platform_device *pdev)
1193+
static void intel_remove(struct platform_device *pdev)
11941194
{
11951195
struct intel_device *idev = platform_get_drvdata(pdev);
11961196

@@ -1201,13 +1201,11 @@ static int intel_remove(struct platform_device *pdev)
12011201
mutex_unlock(&intel_device_list_lock);
12021202

12031203
dev_info(&pdev->dev, "unregistered.\n");
1204-
1205-
return 0;
12061204
}
12071205

12081206
static struct platform_driver intel_driver = {
12091207
.probe = intel_probe,
1210-
.remove = intel_remove,
1208+
.remove_new = intel_remove,
12111209
.driver = {
12121210
.name = "hci_intel",
12131211
.acpi_match_table = ACPI_PTR(intel_acpi_match),

0 commit comments

Comments
 (0)