From patchwork Wed Sep 14 13:57:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 4072 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8CAAB23EF5 for ; Wed, 14 Sep 2011 13:57:46 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 820F5A18806 for ; Wed, 14 Sep 2011 13:57:46 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 23so2339219fxe.11 for ; Wed, 14 Sep 2011 06:57:46 -0700 (PDT) Received: by 10.223.34.143 with SMTP id l15mr755883fad.46.1316008666410; Wed, 14 Sep 2011 06:57:46 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs51611lab; Wed, 14 Sep 2011 06:57:45 -0700 (PDT) Received: by 10.227.59.129 with SMTP id l1mr540174wbh.66.1316008665114; Wed, 14 Sep 2011 06:57:45 -0700 (PDT) Received: from mail-wy0-f178.google.com (mail-wy0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id fe9si3707656wbb.62.2011.09.14.06.57.44 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Sep 2011 06:57:45 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) smtp.mail=dave.martin@linaro.org Received: by mail-wy0-f178.google.com with SMTP id 23so1741687wyf.37 for ; Wed, 14 Sep 2011 06:57:44 -0700 (PDT) Received: by 10.216.53.3 with SMTP id f3mr2282221wec.0.1316008664235; Wed, 14 Sep 2011 06:57:44 -0700 (PDT) Received: from e103592.peterhouse.linaro.org (fw-lnat.cambridge.arm.com. [217.140.96.63]) by mx.google.com with ESMTPS id e2sm4162109wbh.19.2011.09.14.06.57.42 (version=SSLv3 cipher=OTHER); Wed, 14 Sep 2011 06:57:43 -0700 (PDT) From: Dave Martin To: linux-usb@vger.kernel.org Cc: patches@linaro.org, Grant Likely , Arvid Brodin , devicetree-discuss@lists.ozlabs.org, Dave Martin Subject: [PATCH 2/2] isp1760: Fix endianness-sensitivity in of_isp1760_probe() Date: Wed, 14 Sep 2011 14:57:13 +0100 Message-Id: <1316008633-31009-3-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1316008633-31009-1-git-send-email-dave.martin@linaro.org> References: <1316008633-31009-1-git-send-email-dave.martin@linaro.org> 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 Acked-by: Pawel Moll --- 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); + if (bus_width == 16) devflags |= ISP1760_FLAG_BUS_WIDTH_16; if (of_get_property(dp, "port1-otg", NULL) != NULL)