All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Samuel Ortiz <sameo@linux.intel.com>, Lee Jones <lee.jones@linaro.org>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
	Doug Anderson <dianders@chromium.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mfd: max77686: fix support for devices without irq specified
Date: Thu, 07 Aug 2014 18:09:04 +0200	[thread overview]
Message-ID: <1457999.lNPdqEWCCR@amdc1032> (raw)

Before commit 6f1c1e71d933 ("mfd: max77686: Convert to use regmap_irq")
max77686_irq_init() return value was never checked so devices without
irq specified (like Hardkernel's Exynos4412 based ODROID-U3 board)
worked fine even though -ENODEV was returned by the function.  Add
handling for no irq specified case in max77686_i2c_probe() restoring
the previous driver's behavior.

The patch fixes boot for Hardkernel's Exynos4412 based ODROID-U3 board.

Error messages before the patch:
...
[    0.163995] max77686 0-0009: Failed to request IRQ 0 for max77686-pmic: -22
[    0.164020] max77686 0-0009: failed to add PMIC irq chip: -22
[    0.164478] max77686: probe of 0-0009 failed with error -22
...

Fixes: 6f1c1e71d933 ("mfd: max77686: Convert to use regmap_irq")
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Cc: Doug Anderson <dianders@chromium.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
---
patch is against next-20140804 branch of linux-next kernel

 drivers/mfd/max77686.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
index 86e5523..5fe024c 100644
--- a/drivers/mfd/max77686.c
+++ b/drivers/mfd/max77686.c
@@ -314,6 +314,11 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
 		}
 	}
 
+	if (!max77686->irq) {
+		dev_info(max77686->dev, "irq is not specified\n");
+		goto skip_irq_setup;
+	}
+
 	ret = regmap_add_irq_chip(max77686->regmap, max77686->irq,
 				  IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
 				  IRQF_SHARED, 0, irq_chip,
@@ -332,6 +337,7 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
 		goto err_del_irqc;
 	}
 
+skip_irq_setup:
 	ret = mfd_add_devices(max77686->dev, -1, cells, n_devs, NULL, 0, NULL);
 	if (ret < 0) {
 		dev_err(&i2c->dev, "failed to add MFD devices: %d\n", ret);
-- 
1.8.2.3

             reply	other threads:[~2014-08-07 16:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-07 16:09 Bartlomiej Zolnierkiewicz [this message]
2014-08-08  7:59 ` [PATCH] mfd: max77686: fix support for devices without irq specified Krzysztof Kozlowski
2014-08-08  8:58   ` Javier Martinez Canillas
2014-08-08 10:09     ` Javier Martinez Canillas
2014-08-08 10:54       ` Krzysztof Kozlowski
2014-08-08 10:58         ` Javier Martinez Canillas
2014-08-08 12:24           ` Bartlomiej Zolnierkiewicz
2014-08-08 12:38             ` Javier Martinez Canillas

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=1457999.lNPdqEWCCR@amdc1032 \
    --to=b.zolnierkie@samsung.com \
    --cc=dianders@chromium.org \
    --cc=javier.martinez@collabora.co.uk \
    --cc=k.kozlowski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /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.