Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp2481700ybx; Fri, 8 Nov 2019 05:03:35 -0800 (PST) X-Google-Smtp-Source: APXvYqw1hOIshanvOUB9mDzGKr+iVjcXFM1J5AZKPIhCooiL4dihONxUQJUDggShr3zrwaYXlpuv X-Received: by 2002:a5d:4645:: with SMTP id j5mr8857416wrs.329.1573218215234; Fri, 08 Nov 2019 05:03:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573218215; cv=none; d=google.com; s=arc-20160816; b=D00tJCwELn055CLsE7TDCo8P7P9oUs2OkqMM0frS9ej35+XXFZuhCc0Ic0nGck8//0 hshDahJoHBgJ40pk/Jw//AkBvSUFDIZjdVZZJNZd6nIrexy2Y2neITyPnKT9AEDpDRwN +jQXO8n+gYFPfnC30cqBnDxJklwsUnTCpIA5w82GbwSUgpHd9o3SvsV63nuJbfhK5MTr Q9kn3M5mElF9U8S76DrctDCrCq+4wMFnYV8/nNHB86TyewsA8PVn14St84DKgoxFW9Es PzUMcQJbX/rY1CyGPU9cSA4+salUKuJtQK0yd2RvUETs1+sAgK0ODJkmOPrtDqYTQ2e3 AEZw== 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=/C1Eg1dR+pzbI0uF0+AzerXAuAR/n78tvkDzoMBSgLI=; b=na4tstvPqE0lVubxFYu+NijHi+AVhIL30gSFmD38IrCl2teqclYoG/CFRaWwlFyyro PRNr+mlUe7QcWAXtt0BiUq3ustLtbspPejQz8vAfsApHgOofUINMIvuVg+cRWLUPnfll oa0+xxSBbk5Dj6LC8oyLwSU4lCYluGCSSYM+EXWcrNYFgyeRQFKFw2xG5N1jJk6E3SVc oG1vJO6TAyEIdH3zAgj6bbPMmq3A7GejMsK8+L1RgEIO1SJc//exlNjH55GI1qkskN3j wlSdQQ/+n5VxZfRC/jTcU9mHGMeLvDFNmVHjVc3hMIppbfYNtX5PnvdHSU0Jk9Z4OU2D ZBlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="e/P1lD7z"; 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 l12si4688706edk.60.2019.11.08.05.03.11; Fri, 08 Nov 2019 05:03:35 -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="e/P1lD7z"; 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 S1729688AbfKHNCE (ORCPT + 99 others); Fri, 8 Nov 2019 08:02:04 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:36717 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728638AbfKHNCB (ORCPT ); Fri, 8 Nov 2019 08:02:01 -0500 Received: by mail-lj1-f194.google.com with SMTP id k15so6145621lja.3 for ; Fri, 08 Nov 2019 05:01:58 -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=/C1Eg1dR+pzbI0uF0+AzerXAuAR/n78tvkDzoMBSgLI=; b=e/P1lD7zvmjURhmsvbX23QE+8ASowwEgb4BpM1IFfQWI91Tr3jDWiq0X6CrLk99wVN mPk6Txdn0NvIKorqKDh7HBcWVDg2Ic5Yi9fVd1R5QMWlVvOdwlxoWhTPHcB8cInVr8Dv yoknf6mGfRANkmWuDMLpwcTHs5OfxaRyfaFd0= 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=/C1Eg1dR+pzbI0uF0+AzerXAuAR/n78tvkDzoMBSgLI=; b=UAjsgPzIBYJ8OMGGPqwoe00bCIJsDKdSATN8e1c2V0qbtOfXwf4Nd+F1UwYpavdA8H aEnM5xwy/M8Ndr+8+5+z2UOt7wql7pasEaXN/i2rd5HkLeFYivj1fwRL8nhH/gPVmXwP go8bvEoi5DZ4PpzzS9ML9b0RWUf7g0dFLLPa7VgJZ+ApgnFM+CGd2HLkOgWC57ZvL94G I7G2XfRGfY7h1nTHTvDCes+z5N5WdSwlDudYLgh7Yd+8432SK3gn42jOUUUYSmfQEPnd nE1QewLrNZP8XpADUlIaUTRbaAR2zhRDBYpuZeYmcQRC1uQsbopX3wKXpjH2ppdMEihb EMIw== X-Gm-Message-State: APjAAAWDqRz4j242PPZhIjC+ct4C6cR7hrcpuuUZ36shw48508JKaD08 DPkSyXYWTloI56bAkAu1VGqAAA== X-Received: by 2002:a2e:b5a2:: with SMTP id f2mr6611603ljn.108.1573218118236; Fri, 08 Nov 2019 05:01:58 -0800 (PST) Received: from prevas-ravi.prevas.se ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id d28sm2454725lfn.33.2019.11.08.05.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 05:01:57 -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 , Rasmus Villemoes Subject: [PATCH v4 24/47] soc: fsl: qe: qe_io.c: access device tree property using be32_to_cpu Date: Fri, 8 Nov 2019 14:01:00 +0100 Message-Id: <20191108130123.6839-25-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191108130123.6839-1-linux@rasmusvillemoes.dk> References: <20191108130123.6839-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. 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