From patchwork Wed Nov 28 17:53:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 10703053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C40E14BD for ; Wed, 28 Nov 2018 17:56:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17A662CDD8 for ; Wed, 28 Nov 2018 17:56:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 090152DBEC; Wed, 28 Nov 2018 17:56:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8A6A32CDD8 for ; Wed, 28 Nov 2018 17:56:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Oe32748VIc9S9HB/LzznBE/Rz/xV/s3HXsp0AOXNZ4k=; b=HyxTkTXKKhAs1I nU4BNo3EDxD6v5jFPJgjVIEShIg5l9t4ovKvW+K4LVgE99sK9UeedRhGfoKaFYfkJttlT2Obpg7TF PfUrQKMzkLcjToZAv+7fWv2xpYrK0WH7J8hmFKRxIBqt4PyDVX4XqJ9YcbO6VY4j2I0GGJ90Sb8lX eQ26iquv/WofbkF3xEtoQbvJrjELdaSXllw5E/x1ZNqcfS7WKRPm0pgDpEijV6o4NGwK5OS9JrwUu 43T3ldOkP8b2iAV6arnfBZcYTMLSNvqFNcYUAfmw7UmTEHjCXuwiIZOi5qz7l7ax9cZ5AkNFKhjjj xdHc5CAG+4OjkVna2crA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS44H-0007OD-3o; Wed, 28 Nov 2018 17:56:09 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS42f-0004mf-6b for linux-arm-kernel@bombadil.infradead.org; Wed, 28 Nov 2018 17:54:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=57gUT9nudy/lhdbHrPjygzJvxiDrwFuYDC1M3d+60N4=; b=qVY1itlpY/Osa9TUPPfMiHxxVn LdZReOqecuExU3p4sPlIJM5Qag+XpC1zwJL1YMfbgZ5NoPsIW4CiAs6Jd/MFa4voUmtahUU73z5vU Jojr/P89lgV9kxpnslvVyLYxbNtb1voBfUv6SRoacq0lb803OOrS1m7R3MOvT7vZSTHrcJPmyS4P4 QjHMAnFGvj5SP6z9KEeDZZKL3D9jI6KFkpjyIjVntLMycjptiRmbCT79ZQmOYnpwdhXD9AoZ9UAM5 I9j1MNOICbwW4JIJOgsDwuSkOHNqWdsSCNgMLjX7Tu6IBLaHcSphBYazcShL/KOpCy567cqKC6su/ oTWQTJZA==; Received: from shell.v3.sk ([90.176.6.54]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gS42Y-0007wc-Vk for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2018 17:54:24 +0000 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 28241999DE; Wed, 28 Nov 2018 18:54:03 +0100 (CET) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 6_Cd3_dyJWBx; Wed, 28 Nov 2018 18:53:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 3D2D6999C5; Wed, 28 Nov 2018 18:53:39 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Ysa8GWDGdrcW; Wed, 28 Nov 2018 18:53:36 +0100 (CET) Received: from belphegor.brq.redhat.com (nat-pool-brq-t.redhat.com [213.175.37.10]) by zimbra.v3.sk (Postfix) with ESMTPSA id 8D02799B07; Wed, 28 Nov 2018 18:53:31 +0100 (CET) From: Lubomir Rintel To: arm@kernel.org, Olof Johansson , Arnd Bergmann Subject: [PATCH v4 12/20] irqchip/mmp: do not use of_address_to_resource() to get mux regs Date: Wed, 28 Nov 2018 18:53:16 +0100 Message-Id: <20181128175324.163202-13-lkundrak@v3.sk> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181128175324.163202-1-lkundrak@v3.sk> References: <20181128175324.163202-1-lkundrak@v3.sk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_125423_187144_F9138347 X-CRM114-Status: GOOD ( 11.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Miao , James Cameron , Russell King , Haojian Zhuang , linux-kernel@vger.kernel.org, Lubomir Rintel , Pavel Machek , Robert Jarzmik , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The "regs" property of the "mrvl,mmp2-mux-intc" devices are silly. They are offsets from intc's base, not addresses on the parent bus. At this point it probably can't be fixed. On an OLPC XO-1.75 machine, the muxes are children of the intc, not the axi bus, and thus of_address_to_resource() won't work. We should treat the values as mere integers as opposed to bus addresses. Signed-off-by: Lubomir Rintel Acked-by: Pavel Machek --- Changes since v3: - Added this patch drivers/irqchip/irq-mmp.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/irqchip/irq-mmp.c b/drivers/irqchip/irq-mmp.c index 1ed38f9f1d0a..e34b57f006e3 100644 --- a/drivers/irqchip/irq-mmp.c +++ b/drivers/irqchip/irq-mmp.c @@ -423,9 +423,9 @@ IRQCHIP_DECLARE(mmp2_intc, "mrvl,mmp2-intc", mmp2_of_init); static int __init mmp2_mux_of_init(struct device_node *node, struct device_node *parent) { - struct resource res; int i, ret, irq, j = 0; u32 nr_irqs, mfp_irq; + u32 reg[4]; if (!parent) return -ENODEV; @@ -437,18 +437,13 @@ static int __init mmp2_mux_of_init(struct device_node *node, pr_err("Not found mrvl,intc-nr-irqs property\n"); return -EINVAL; } - ret = of_address_to_resource(node, 0, &res); + ret = of_property_read_u32_array(node, "reg", reg, ARRAY_SIZE(reg)); if (ret < 0) { pr_err("Not found reg property\n"); return -EINVAL; } - icu_data[i].reg_status = mmp_icu_base + res.start; - ret = of_address_to_resource(node, 1, &res); - if (ret < 0) { - pr_err("Not found reg property\n"); - return -EINVAL; - } - icu_data[i].reg_mask = mmp_icu_base + res.start; + icu_data[i].reg_status = mmp_icu_base + reg[0]; + icu_data[i].reg_mask = mmp_icu_base + reg[2]; icu_data[i].cascade_irq = irq_of_parse_and_map(node, 0); if (!icu_data[i].cascade_irq) return -EINVAL;