* [PATCH] usb: host: ohci-pxa27x: use of_property_read_bool()
@ 2015-11-15 14:29 Saurabh Sengar
2015-11-16 12:15 ` Sergei Shtylyov
0 siblings, 1 reply; 4+ messages in thread
From: Saurabh Sengar @ 2015-11-15 14:29 UTC (permalink / raw)
To: stern, gregkh, linux-usb, linux-kernel; +Cc: Saurabh Sengar
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] usb: host: ohci-pxa27x: use of_property_read_bool()
2015-11-15 14:29 [PATCH] usb: host: ohci-pxa27x: use of_property_read_bool() Saurabh Sengar
@ 2015-11-16 12:15 ` Sergei Shtylyov
2015-11-16 12:48 ` [PATCH v2] " Saurabh Sengar
0 siblings, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2015-11-16 12:15 UTC (permalink / raw)
To: Saurabh Sengar, stern, gregkh, linux-usb, linux-kernel
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] usb: host: ohci-pxa27x: use of_property_read_bool()
2015-11-16 12:15 ` Sergei Shtylyov
@ 2015-11-16 12:48 ` Saurabh Sengar
2015-11-16 15:43 ` Alan Stern
0 siblings, 1 reply; 4+ messages in thread
From: Saurabh Sengar @ 2015-11-16 12:48 UTC (permalink / raw)
To: sergei.shtylyov, stern, gregkh, linux-usb, linux-kernel; +Cc: Saurabh Sengar
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] usb: host: ohci-pxa27x: use of_property_read_bool()
2015-11-16 12:48 ` [PATCH v2] " Saurabh Sengar
@ 2015-11-16 15:43 ` Alan Stern
0 siblings, 0 replies; 4+ messages in thread
From: Alan Stern @ 2015-11-16 15:43 UTC (permalink / raw)
To: Saurabh Sengar; +Cc: sergei.shtylyov, gregkh, linux-usb, linux-kernel
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-11-16 15:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-15 14:29 [PATCH] usb: host: ohci-pxa27x: use of_property_read_bool() Saurabh Sengar
2015-11-16 12:15 ` Sergei Shtylyov
2015-11-16 12:48 ` [PATCH v2] " Saurabh Sengar
2015-11-16 15:43 ` Alan Stern
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.