serial: samsung: improve code clarity by defining a variable
authorNaveen Krishna Chatradhi <ch.naveen@samsung.com>
Mon, 14 Jul 2014 11:37:18 +0000 (17:07 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jul 2014 01:18:22 +0000 (18:18 -0700)
The of_node is derived from pdev for every usage, define a
device_node variable instead.

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/samsung.c

index d98f93db85f9cb3bbcfb2bd3e83519c32092e8f6..4aff02d6712ee7448ac11e10379e405475d04a0a 100644 (file)
@@ -1269,12 +1269,13 @@ static inline struct s3c24xx_serial_drv_data *s3c24xx_get_driver_data(
 
 static int s3c24xx_serial_probe(struct platform_device *pdev)
 {
+       struct device_node *np = pdev->dev.of_node;
        struct s3c24xx_uart_port *ourport;
        int index = probe_index;
        int ret;
 
-       if (pdev->dev.of_node) {
-               ret = of_alias_get_id(pdev->dev.of_node, "serial");
+       if (np) {
+               ret = of_alias_get_id(np, "serial");
                if (ret >= 0)
                        index = ret;
        }
@@ -1295,8 +1296,8 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
                        dev_get_platdata(&pdev->dev) :
                        ourport->drv_data->def_cfg;
 
-       if (pdev->dev.of_node)
-               of_property_read_u32(pdev->dev.of_node,
+       if (np)
+               of_property_read_u32(np,
                        "samsung,uart-fifosize", &ourport->port.fifosize);
 
        if (!ourport->port.fifosize) {
This page took 0.026681 seconds and 5 git commands to generate.