From patchwork Mon Jun 9 19:27:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 4323181 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 43FA39F387 for ; Mon, 9 Jun 2014 19:31:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77AA420149 for ; Mon, 9 Jun 2014 19:31:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F5A720125 for ; Mon, 9 Jun 2014 19:31:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wu5F6-00048h-R4; Mon, 09 Jun 2014 19:28:28 +0000 Received: from top.free-electrons.com ([176.31.233.9] helo=mail.free-electrons.com) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wu5F4-0003zp-16 for linux-arm-kernel@lists.infradead.org; Mon, 09 Jun 2014 19:28:26 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id 547AB850; Mon, 9 Jun 2014 21:28:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost.localdomain (unknown [190.2.108.30]) by mail.free-electrons.com (Postfix) with ESMTPSA id DC8407B5; Mon, 9 Jun 2014 21:28:06 +0200 (CEST) From: Ezequiel Garcia To: Subject: [RFC/PATCH] ARM: mvebu: Don't apply the quirks if the SoC revision is unknown Date: Mon, 9 Jun 2014 16:27:16 -0300 Message-Id: <1402342036-9168-1-git-send-email-ezequiel.garcia@free-electrons.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140609_122826_219740_13C8C22C X-CRM114-Status: GOOD ( 10.93 ) X-Spam-Score: 0.3 (/) Cc: Thomas Petazzoni , Lior Amsalem , Jason Cooper , Tawfik Bayouk , Ezequiel Garcia , Gregory Clement X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 We currently skip the I2C and thermal quirks only if the SoC revision is known to be one that does not need them. If the SoC revision cannot be obtained, the current behavior is to apply the quirk assuming it's needed. This commit changes this, by requiring the SoC revision to be known in order to peform a quirk. Signed-off-by: Ezequiel Garcia --- arch/arm/mach-mvebu/board-v7.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c index 594262b..14bf590 100644 --- a/arch/arm/mach-mvebu/board-v7.c +++ b/arch/arm/mach-mvebu/board-v7.c @@ -89,13 +89,15 @@ static void __init i2c_quirk(void) { struct device_node *np; u32 dev, rev; + int res; /* * Only revisons more recent than A0 support the offload * mechanism. We can exit only if we are sure that we can * get the SoC revision and it is more recent than A0. */ - if (mvebu_get_soc_id(&dev, &rev) == 0 && rev > MV78XX0_A0_REV) + res = mvebu_get_soc_id(&dev, &rev); + if (res < 0 || (res == 0 && rev > MV78XX0_A0_REV)) return; for_each_compatible_node(np, NULL, "marvell,mv78230-i2c") { @@ -119,8 +121,10 @@ static void __init thermal_quirk(void) { struct device_node *np; u32 dev, rev; + int res; - if (mvebu_get_soc_id(&dev, &rev) == 0 && rev > ARMADA_375_Z1_REV) + res = mvebu_get_soc_id(&dev, &rev); + if (res < 0 || (res == 0 && rev > ARMADA_375_Z1_REV)) return; for_each_compatible_node(np, NULL, "marvell,armada375-thermal") {