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


Groups > linux.kernel > #1269708 > unrolled thread

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

Started bySaurabh Sengar <saurabh.truth@gmail.com>
First post2015-11-15 15:40 +0100
Last post2015-11-16 16:50 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [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

#1269708 — [PATCH] usb: host: ohci-pxa27x: use of_property_read_bool()

FromSaurabh Sengar <saurabh.truth@gmail.com>
Date2015-11-15 15:40 +0100
Subject[PATCH] usb: host: ohci-pxa27x: use of_property_read_bool()
Message-ID<qv6Dg-2zJ-5@gated-at.bofh.it>
for checking if a property is present or not,
of_property_read_bool is more appropriate then of_get_property()

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
---
 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/

[toc] | [next] | [standalone]


#1270062

FromSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date2015-11-16 13:20 +0100
Message-ID<qvqVk-7cN-31@gated-at.bofh.it>
In reply to#1269708
Hello.

On 11/15/2015 5:29 PM, Saurabh Sengar wrote:

> for checking if a property is present or not,
> of_property_read_bool is more appropriate then of_get_property()

    s/then/than/.

> Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>

[...]

MBR, Sergei


--
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/

[toc] | [prev] | [next] | [standalone]


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

FromSaurabh Sengar <saurabh.truth@gmail.com>
Date2015-11-16 14:00 +0100
Subject[PATCH v2] usb: host: ohci-pxa27x: use of_property_read_bool()
Message-ID<qvry3-7qr-35@gated-at.bofh.it>
In reply to#1270062
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/

[toc] | [prev] | [next] | [standalone]


#1270297 — Re: [PATCH v2] usb: host: ohci-pxa27x: use of_property_read_bool()

FromAlan Stern <stern@rowland.harvard.edu>
Date2015-11-16 16:50 +0100
SubjectRe: [PATCH v2] usb: host: ohci-pxa27x: use of_property_read_bool()
Message-ID<qvucx-It-17@gated-at.bofh.it>
In reply to#1270096
On Mon, 16 Nov 2015, Saurabh Sengar wrote:

> 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

Acked-by: Alan Stern <stern@rowland.harvard.edu>

--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web