All of lore.kernel.org
 help / color / mirror / Atom feed
From: ezequiel.garcia@free-electrons.com (Ezequiel Garcia)
To: linux-arm-kernel@lists.infradead.org
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	[thread overview]
Message-ID: <1402342036-9168-1-git-send-email-ezequiel.garcia@free-electrons.com> (raw)

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 <ezequiel.garcia@free-electrons.com>
---
 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") {
-- 
1.9.1

             reply	other threads:[~2014-06-09 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09 19:27 Ezequiel Garcia [this message]
2014-06-10  8:21 ` [RFC/PATCH] ARM: mvebu: Don't apply the quirks if the SoC revision is unknown Arnd Bergmann
2014-06-10 13:40   ` Ezequiel Garcia
2014-06-10 15:39     ` Gregory CLEMENT
2014-06-10 15:49       ` Ezequiel Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402342036-9168-1-git-send-email-ezequiel.garcia@free-electrons.com \
    --to=ezequiel.garcia@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.