mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
UPSTREAM: serial: qcom_geni: 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 <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231110152927.70601-32-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Bug: 370629635 Change-Id: I5d64129414dbd303ae50544ffa9385611dfabda7 (cherry picked from commit dd4d4497be8ff2a72e4345c3c1b6450cadfa75d6) Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
This commit is contained in:
committed by
Praveen Talari
parent
7161dbc311
commit
2c16ff3847
@@ -1691,7 +1691,7 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int qcom_geni_serial_remove(struct platform_device *pdev)
|
||||
static void qcom_geni_serial_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct qcom_geni_serial_port *port = platform_get_drvdata(pdev);
|
||||
struct uart_driver *drv = port->private_data.drv;
|
||||
@@ -1699,8 +1699,6 @@ static int qcom_geni_serial_remove(struct platform_device *pdev)
|
||||
dev_pm_clear_wake_irq(&pdev->dev);
|
||||
device_init_wakeup(&pdev->dev, false);
|
||||
uart_remove_one_port(drv, &port->uport);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int qcom_geni_serial_sys_suspend(struct device *dev)
|
||||
@@ -1800,7 +1798,7 @@ static const struct of_device_id qcom_geni_serial_match_table[] = {
|
||||
MODULE_DEVICE_TABLE(of, qcom_geni_serial_match_table);
|
||||
|
||||
static struct platform_driver qcom_geni_serial_platform_driver = {
|
||||
.remove = qcom_geni_serial_remove,
|
||||
.remove_new = qcom_geni_serial_remove,
|
||||
.probe = qcom_geni_serial_probe,
|
||||
.driver = {
|
||||
.name = "qcom_geni_serial",
|
||||
|
||||
Reference in New Issue
Block a user