Thread (1 message) 1 message, 1 author, 2011-09-14

Re: [PATCH 2/2] isp1760: Fix endianness-sensitivity in of_isp1760_probe()

From: Grant Likely <hidden>
Date: 2011-09-14 15:46:29

On Wed, Sep 14, 2011 at 02:57:13PM +0100, Dave Martin wrote:
quoted hunk
Data read direct from device tree properties will be in the device
tree's native endianness (i.e., big-endian).

This patch uses of_property_read_u32() to read the bus-width
property in host byte order instead.

Signed-off-by: Dave Martin <redacted>
Acked-by: Pawel Moll <redacted>
---
 drivers/usb/host/isp1760-if.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
index 69ee32c..fa99c27 100644
--- a/drivers/usb/host/isp1760-if.c
+++ b/drivers/usb/host/isp1760-if.c
@@ -39,8 +39,8 @@ static int of_isp1760_probe(struct platform_device *dev)
 	int virq;
 	resource_size_t res_len;
 	int ret;
-	const unsigned int *prop;
 	unsigned int devflags = 0;
+	u32 bus_width = 0;
 
 	ret = of_address_to_resource(dp, 0, &memory);
 	if (ret)
@@ -64,8 +64,8 @@ static int of_isp1760_probe(struct platform_device *dev)
 		devflags |= ISP1760_FLAG_ISP1761;
 
 	/* Some systems wire up only 16 of the 32 data lines */
-	prop = of_get_property(dp, "bus-width", NULL);
-	if (prop && *prop == 16)
+	of_property_read_u32(dp, "bus-width", bus_width);
Shouldn't this be '&bus_width'?

g.
+	if (bus_width == 16)
 		devflags |= ISP1760_FLAG_BUS_WIDTH_16;
 
 	if (of_get_property(dp, "port1-otg", NULL) != NULL)
-- 
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help