serial: 8250_of: use of_property_read_bool()
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sun, 20 Aug 2017 16:51:55 +0000 (19:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Aug 2017 18:51:20 +0000 (20:51 +0200)
Use slightly more compact of_property_read_bool() calls for the boolean
properties instead of of_find_property() calls.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_of.c

index 6c5a8ca9fff8deea06fb59ce85957c4623286b68..8867b63eb3a3361a9d252355b0f50a7e41275691 100644 (file)
@@ -146,7 +146,7 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
        port->flags = UPF_SHARE_IRQ | UPF_BOOT_AUTOCONF | UPF_IOREMAP
                | UPF_FIXED_PORT | UPF_FIXED_TYPE;
 
-       if (of_find_property(np, "no-loopback-test", NULL))
+       if (of_property_read_bool(np, "no-loopback-test"))
                port->flags |= UPF_SKIP_TEST;
 
        port->dev = &ofdev->dev;
@@ -192,7 +192,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
        if (!match)
                return -EINVAL;
 
-       if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL))
+       if (of_property_read_bool(ofdev->dev.of_node, "used-by-rtas"))
                return -EBUSY;
 
        info = kzalloc(sizeof(*info), GFP_KERNEL);