Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ad028bd authored by Dave Martin's avatar Dave Martin Committed by Greg Kroah-Hartman
Browse files

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: default avatarDave Martin <dave.martin@linaro.org>
Acked-by: default avatarPawel Moll <pawel.moll@arm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7fb57a01
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -47,9 +47,9 @@ static int of_isp1760_probe(struct platform_device *dev)
	int virq;
	int virq;
	resource_size_t res_len;
	resource_size_t res_len;
	int ret;
	int ret;
	const unsigned int *prop;
	unsigned int devflags = 0;
	unsigned int devflags = 0;
	enum of_gpio_flags gpio_flags;
	enum of_gpio_flags gpio_flags;
	u32 bus_width = 0;


	drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
	drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
	if (!drvdata)
	if (!drvdata)
@@ -77,8 +77,8 @@ static int of_isp1760_probe(struct platform_device *dev)
		devflags |= ISP1760_FLAG_ISP1761;
		devflags |= ISP1760_FLAG_ISP1761;


	/* Some systems wire up only 16 of the 32 data lines */
	/* Some systems wire up only 16 of the 32 data lines */
	prop = of_get_property(dp, "bus-width", NULL);
	of_property_read_u32(dp, "bus-width", &bus_width);
	if (prop && *prop == 16)
	if (bus_width == 16)
		devflags |= ISP1760_FLAG_BUS_WIDTH_16;
		devflags |= ISP1760_FLAG_BUS_WIDTH_16;


	if (of_get_property(dp, "port1-otg", NULL) != NULL)
	if (of_get_property(dp, "port1-otg", NULL) != NULL)