Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270096

[PATCH v2] usb: host: ohci-pxa27x: use of_property_read_bool()

From Saurabh Sengar <saurabh.truth@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v2] usb: host: ohci-pxa27x: use of_property_read_bool()
Date 2015-11-16 14:00 +0100
Message-ID <qvry3-7qr-35@gated-at.bofh.it> (permalink)
References <qvqVk-7cN-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
v2 : replaced then to than in description

 drivers/usb/host/ohci-pxa27x.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index ba1bec7..e8c006e 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -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;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] usb: host: ohci-pxa27x: use of_property_read_bool() Saurabh Sengar <saurabh.truth@gmail.com> - 2015-11-15 15:40 +0100
  Re: [PATCH] usb: host: ohci-pxa27x: use of_property_read_bool() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-11-16 13:20 +0100
    [PATCH v2] usb: host: ohci-pxa27x: use of_property_read_bool() Saurabh Sengar <saurabh.truth@gmail.com> - 2015-11-16 14:00 +0100
      Re: [PATCH v2] usb: host: ohci-pxa27x: use of_property_read_bool() Alan Stern <stern@rowland.harvard.edu> - 2015-11-16 16:50 +0100

csiph-web