Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6874060ybc; Thu, 28 Nov 2019 06:59:42 -0800 (PST) X-Google-Smtp-Source: APXvYqw3YHuBF+MI/PWGX1qzj+EPNufwsY+tgfSVcE94/tZaWQ1HpghuetR4qX44hOKUB9T5/LEc X-Received: by 2002:a17:906:7812:: with SMTP id u18mr54762767ejm.6.1574953182411; Thu, 28 Nov 2019 06:59:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574953182; cv=none; d=google.com; s=arc-20160816; b=J/TvuNQVxojZ20Jykx8LjniXH7xBORKnBU9dlpiXU7enrl4bldLiDUUMdNZUR4MfK/ IehC3nMxon6IJqCj0UFz6vePBAdix3t4PlHMuJ4mlf2+HtWYfjOJChJMvYzh2VuSf+Zj /JJAoIrNg/Vcf1an1DkI1tTxf/mQ2BZejTMGEe3PDE9E/FzsLvyFL3EPb5c1IP0jCEBp BW+pOTQKMhFME4haLLXkwkzN9JhZkJ46Zmq2f0yNUqmfGh0hSkHEdoUTYZ6a50reAaUI TR6OYSXlgSECnejq1gisskgGj8L7DNcpkyXE7Iri7o/qfnm1odf3sQla2rOo10MOoRub Mi8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BSlK9oe7tFf//4Qy2NfrnF4d5nSvsXgepmZkqSuzx3I=; b=JBkRVwh34wniiqwEZHPVaaHGbhblnrsNj5DEtmzZo72yrrPCsSP3Xe4yCx4zEvZOdo IdRgs0kMuRVFV/LyZy/FHm41XKFmpTh+5NSIozsxK9cc4gZr9vV3wPiFUf0DEH5A8RMl tW9m2AUfNvgo5n1TsRA+7gRZXqezXDh39UiGHtUJHI5IZkkXBcLpneXZUzGixLgK09m3 OtxFiB2KxzSAvjHz2odscc84Pf860k9rofMl1TLzQhr/888JDxVq3SJMr99GjwrT3nxy WTidYCWA7mU/CHB9C9dq2lUN4BmIYbQt7jq1jIlTrTGLIAGLKyL1OdufQA3dSwuheQU3 5lhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Nb+BtkNb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si11852105ejq.36.2019.11.28.06.59.17; Thu, 28 Nov 2019 06:59:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=Nb+BtkNb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727437AbfK1O5n (ORCPT + 99 others); Thu, 28 Nov 2019 09:57:43 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:45824 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727403AbfK1O5j (ORCPT ); Thu, 28 Nov 2019 09:57:39 -0500 Received: by mail-lj1-f193.google.com with SMTP id n21so28798044ljg.12 for ; Thu, 28 Nov 2019 06:57:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BSlK9oe7tFf//4Qy2NfrnF4d5nSvsXgepmZkqSuzx3I=; b=Nb+BtkNbxW1BFcECDh6UFX0iJiRNDoxBTj+VizTAjinoSja93AqETCqS4cEavhjWkU 3iE4Cmjv5xaW+1gHMEVlLUsnwNGjzQuPN/YY1M3er+gz3s6Fv9ckj1/4W2+YczmawVgE C7r/S6KFnTAvFtE/Z0rVuqdYCbgkcXiYE2CNU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BSlK9oe7tFf//4Qy2NfrnF4d5nSvsXgepmZkqSuzx3I=; b=qAbPVynYvkOikj02i5Iakdi/hSEUUdGeuptAERVo+3TtUeklT/Rg3qEOMJ0F1SDmqP mSlLH6/vfr831zUnGIdXwR+UkxCNRz3T6XOXlBQl2J0KKwRwz4XF23QpNpUedJG1LUoc /LukIyAM0ddqXfBBfsrXG7xiLnpihMZK3HSLaU9AU0BBOyGHhMPqtZYC+259vMWw/zUz f71MMD1yruJbVPz3Qd/AtUJxulT8stUTW0f43v4/gZ/7hP2+m6NWUY5r5wfGkNbIM+Le 4B4USQ2G0kxm6k/GoVvezc4poPbzLHzQ/3eqpImnxd/5r5OI0kXuzOOlXGm7tQKPk6T9 w1jw== X-Gm-Message-State: APjAAAX7KpFQ1Gsn698RylHqQX6W5gD4uKZ2eSm9BexH94oTWRcseJar O2SMpcwj4pUfwoLcZiWC3tVdqA== X-Received: by 2002:a2e:96cc:: with SMTP id d12mr34338565ljj.210.1574953056036; Thu, 28 Nov 2019 06:57:36 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id u2sm2456803lfl.18.2019.11.28.06.57.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 06:57:35 -0800 (PST) From: Rasmus Villemoes To: Qiang Zhao , Li Yang , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Scott Wood , Timur Tabi , Rasmus Villemoes Subject: [PATCH v6 24/49] soc: fsl: qe: qe_io.c: access device tree property using be32_to_cpu Date: Thu, 28 Nov 2019 15:55:29 +0100 Message-Id: <20191128145554.1297-25-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191128145554.1297-1-linux@rasmusvillemoes.dk> References: <20191128145554.1297-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We need to apply be32_to_cpu to make this work correctly on little-endian hosts. Reviewed-by: Timur Tabi Signed-off-by: Rasmus Villemoes --- drivers/soc/fsl/qe/qe_io.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/qe/qe_io.c b/drivers/soc/fsl/qe/qe_io.c index 99aeb01586bd..61dd8eb8c0fe 100644 --- a/drivers/soc/fsl/qe/qe_io.c +++ b/drivers/soc/fsl/qe/qe_io.c @@ -142,7 +142,7 @@ int par_io_of_config(struct device_node *np) { struct device_node *pio; int pio_map_len; - const unsigned int *pio_map; + const __be32 *pio_map; if (par_io == NULL) { printk(KERN_ERR "par_io not initialized\n"); @@ -167,9 +167,15 @@ int par_io_of_config(struct device_node *np) } while (pio_map_len > 0) { - par_io_config_pin((u8) pio_map[0], (u8) pio_map[1], - (int) pio_map[2], (int) pio_map[3], - (int) pio_map[4], (int) pio_map[5]); + u8 port = be32_to_cpu(pio_map[0]); + u8 pin = be32_to_cpu(pio_map[1]); + int dir = be32_to_cpu(pio_map[2]); + int open_drain = be32_to_cpu(pio_map[3]); + int assignment = be32_to_cpu(pio_map[4]); + int has_irq = be32_to_cpu(pio_map[5]); + + par_io_config_pin(port, pin, dir, open_drain, + assignment, has_irq); pio_map += 6; pio_map_len -= 6; } -- 2.23.0