serial: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bu işleme şunda yer alıyor:

işlemeyi yapan:
Greg Kroah-Hartman

ebeveyn
9d141cb977
işleme
696faedd61
@@ -1451,7 +1451,7 @@ static int ucc_uart_probe(struct platform_device *ofdev)
|
||||
goto out_np;
|
||||
}
|
||||
|
||||
dev_set_drvdata(&ofdev->dev, qe_port);
|
||||
platform_set_drvdata(ofdev, qe_port);
|
||||
|
||||
dev_info(&ofdev->dev, "UCC%u assigned to /dev/ttyQE%u\n",
|
||||
qe_port->ucc_num + 1, qe_port->port.line);
|
||||
@@ -1471,13 +1471,12 @@ out_free:
|
||||
|
||||
static int ucc_uart_remove(struct platform_device *ofdev)
|
||||
{
|
||||
struct uart_qe_port *qe_port = dev_get_drvdata(&ofdev->dev);
|
||||
struct uart_qe_port *qe_port = platform_get_drvdata(ofdev);
|
||||
|
||||
dev_info(&ofdev->dev, "removing /dev/ttyQE%u\n", qe_port->port.line);
|
||||
|
||||
uart_remove_one_port(&ucc_uart_driver, &qe_port->port);
|
||||
|
||||
dev_set_drvdata(&ofdev->dev, NULL);
|
||||
kfree(qe_port);
|
||||
|
||||
return 0;
|
||||
|
Yeni konuda referans
Bir kullanıcı engelle