usb: host: ohci-pxa27x: use of_property_read_bool()
authorSaurabh Sengar <saurabh.truth@gmail.com>
Mon, 16 Nov 2015 12:48:33 +0000 (18:18 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Dec 2015 22:36:29 +0000 (14:36 -0800)
for checking if a property is present or not,
of_property_read_bool is more appropriate than of_get_property()

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-pxa27x.c

index ba1bec7db026d57c4093de1d34f49147ffcb764c..e8c006e7a960831f37ddf55a38892331a0e6a4ca 100644 (file)
@@ -365,19 +365,19 @@ static int ohci_pxa_of_init(struct platform_device *pdev)
        if (!pdata)
                return -ENOMEM;
 
-       if (of_get_property(np, "marvell,enable-port1", NULL))
+       if (of_property_read_bool(np, "marvell,enable-port1"))
                pdata->flags |= ENABLE_PORT1;
-       if (of_get_property(np, "marvell,enable-port2", NULL))
+       if (of_property_read_bool(np, "marvell,enable-port2"))
                pdata->flags |= ENABLE_PORT2;
-       if (of_get_property(np, "marvell,enable-port3", NULL))
+       if (of_property_read_bool(np, "marvell,enable-port3"))
                pdata->flags |= ENABLE_PORT3;
-       if (of_get_property(np, "marvell,port-sense-low", NULL))
+       if (of_property_read_bool(np, "marvell,port-sense-low"))
                pdata->flags |= POWER_SENSE_LOW;
-       if (of_get_property(np, "marvell,power-control-low", NULL))
+       if (of_property_read_bool(np, "marvell,power-control-low"))
                pdata->flags |= POWER_CONTROL_LOW;
-       if (of_get_property(np, "marvell,no-oc-protection", NULL))
+       if (of_property_read_bool(np, "marvell,no-oc-protection"))
                pdata->flags |= NO_OC_PROTECTION;
-       if (of_get_property(np, "marvell,oc-mode-perport", NULL))
+       if (of_property_read_bool(np, "marvell,oc-mode-perport"))
                pdata->flags |= OC_MODE_PERPORT;
        if (!of_property_read_u32(np, "marvell,power-on-delay", &tmp))
                pdata->power_on_delay = tmp;