[RFC 07/17] usb/ehci: use of_read_ulong() in xilinx code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



of_read_ulong() should be used while converting properties to integers.
Current code works simply because xilinx and DT are both BE.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@xxxxxxxxxxxxx>
---
 drivers/usb/host/ehci-xilinx-of.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-xilinx-of.c b/drivers/usb/host/ehci-xilinx-of.c
index 2241935..38fca68 100644
--- a/drivers/usb/host/ehci-xilinx-of.c
+++ b/drivers/usb/host/ehci-xilinx-of.c
@@ -160,7 +160,7 @@ static int __devinit ehci_hcd_xilinx_of_probe(struct platform_device *op)
 	struct resource *res;
 	int irq;
 	int rv;
-	int *value;
+	const void *prop;
 
 	if (usb_disabled())
 		return -ENODEV;
@@ -209,8 +209,8 @@ static int __devinit ehci_hcd_xilinx_of_probe(struct platform_device *op)
 
 	/* Check whether the FS support option is selected in the hardware.
 	 */
-	value = (int *)of_get_property(dn, "xlnx,support-usb-fs", NULL);
-	if (value && (*value == 1)) {
+	prop = of_get_property(dn, "xlnx,support-usb-fs", NULL);
+	if (prop && of_read_ulong(prop, 1) == 1) {
 		ehci_dbg(ehci, "USB host controller supports FS devices\n");
 		hcd->has_tt = 1;
 	} else {
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux