Commit 525667c0 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

serial: 8250_of: Use of_device_get_match_data()

Use of_device_get_match_data() to simplify the code a bit.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a188339c
...@@ -205,18 +205,16 @@ static int of_platform_serial_setup(struct platform_device *ofdev, ...@@ -205,18 +205,16 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
/* /*
* Try to register a serial port * Try to register a serial port
*/ */
static const struct of_device_id of_platform_serial_table[];
static int of_platform_serial_probe(struct platform_device *ofdev) static int of_platform_serial_probe(struct platform_device *ofdev)
{ {
const struct of_device_id *match;
struct of_serial_info *info; struct of_serial_info *info;
struct uart_8250_port port8250; struct uart_8250_port port8250;
unsigned int port_type;
u32 tx_threshold; u32 tx_threshold;
int port_type;
int ret; int ret;
match = of_match_device(of_platform_serial_table, &ofdev->dev); port_type = (unsigned long)of_device_get_match_data(&ofdev->dev);
if (!match) if (port_type == PORT_UNKNOWN)
return -EINVAL; return -EINVAL;
if (of_property_read_bool(ofdev->dev.of_node, "used-by-rtas")) if (of_property_read_bool(ofdev->dev.of_node, "used-by-rtas"))
...@@ -226,7 +224,6 @@ static int of_platform_serial_probe(struct platform_device *ofdev) ...@@ -226,7 +224,6 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
if (info == NULL) if (info == NULL)
return -ENOMEM; return -ENOMEM;
port_type = (unsigned long)match->data;
memset(&port8250, 0, sizeof(port8250)); memset(&port8250, 0, sizeof(port8250));
ret = of_platform_serial_setup(ofdev, port_type, &port8250.port, info); ret = of_platform_serial_setup(ofdev, port_type, &port8250.port, info);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment