@@ -1457,7 +1457,7 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
uport->private_data = &port->private_data;
platform_set_drvdata(pdev, port);
- ret = uart_add_one_port(drv, uport);
+ ret = devm_uart_add_one_port(&pdev->dev, drv, uport);
if (ret)
return ret;
@@ -1466,7 +1466,6 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
IRQF_TRIGGER_HIGH, port->name, uport);
if (ret) {
dev_err(uport->dev, "Failed to get IRQ ret %d\n", ret);
- uart_remove_one_port(drv, uport);
return ret;
}
@@ -1483,7 +1482,6 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
port->wakeup_irq);
if (ret) {
device_init_wakeup(&pdev->dev, false);
- uart_remove_one_port(drv, uport);
return ret;
}
}
@@ -1493,12 +1491,8 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
static int 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;
-
dev_pm_clear_wake_irq(&pdev->dev);
device_init_wakeup(&pdev->dev, false);
- uart_remove_one_port(drv, &port->uport);
return 0;
}