diff options
author | Dave Martin <dave.martin@linaro.org> | 2011-12-02 11:58:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-09 19:18:18 -0500 |
commit | 8ad028bd973ec1ead4982e21ab0400c956aff4b5 (patch) | |
tree | f0dcf9ff3aa668698f794bb29b6a3733ac5a218b /drivers/usb/host/isp1760-if.c | |
parent | 7fb57a019f94ea0c1290c39b8da753be155af41c (diff) |
USB: isp1760: Fix endianness-sensitivity in of_isp1760_probe()
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 <dave.martin@linaro.org>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/isp1760-if.c')
-rw-r--r-- | 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 a7dc1e1d45f..b605224fb9e 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c | |||
@@ -47,9 +47,9 @@ static int of_isp1760_probe(struct platform_device *dev) | |||
47 | int virq; | 47 | int virq; |
48 | resource_size_t res_len; | 48 | resource_size_t res_len; |
49 | int ret; | 49 | int ret; |
50 | const unsigned int *prop; | ||
51 | unsigned int devflags = 0; | 50 | unsigned int devflags = 0; |
52 | enum of_gpio_flags gpio_flags; | 51 | enum of_gpio_flags gpio_flags; |
52 | u32 bus_width = 0; | ||
53 | 53 | ||
54 | drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); | 54 | drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL); |
55 | if (!drvdata) | 55 | if (!drvdata) |
@@ -77,8 +77,8 @@ static int of_isp1760_probe(struct platform_device *dev) | |||
77 | devflags |= ISP1760_FLAG_ISP1761; | 77 | devflags |= ISP1760_FLAG_ISP1761; |
78 | 78 | ||
79 | /* Some systems wire up only 16 of the 32 data lines */ | 79 | /* Some systems wire up only 16 of the 32 data lines */ |
80 | prop = of_get_property(dp, "bus-width", NULL); | 80 | of_property_read_u32(dp, "bus-width", &bus_width); |
81 | if (prop && *prop == 16) | 81 | if (bus_width == 16) |
82 | devflags |= ISP1760_FLAG_BUS_WIDTH_16; | 82 | devflags |= ISP1760_FLAG_BUS_WIDTH_16; |
83 | 83 | ||
84 | if (of_get_property(dp, "port1-otg", NULL) != NULL) | 84 | if (of_get_property(dp, "port1-otg", NULL) != NULL) |