public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <broonie@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <patches@opensource.cirrus.com>
Subject: [PATCH] regmap: irq: Make IRQ type support optional
Date: Fri, 28 Dec 2018 11:23:58 +0000	[thread overview]
Message-ID: <20181228112358.5914-1-ckeepax@opensource.cirrus.com> (raw)

Currently only gpio-max77620 is using the type support in regmap IRQ,
but the implementation causes the irq_set_type operation to fail on all
other regmap IRQ chips. Avoid these regressions by skipping the type
handling on any chips that don't define a set of supported types.

Fixes: 1c2928e3e321 ("regmap: regmap-irq/gpio-max77620: add level-irq support")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 drivers/base/regmap/regmap-irq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index 1bd1145ad8b5e..8c674f1ad0fc8 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -257,6 +257,9 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type)
 	int reg;
 	const struct regmap_irq_type *t = &irq_data->type;
 
+	if (!t->types_supported)
+		return 0;
+
 	if ((t->types_supported & type) != type)
 		return -ENOTSUPP;
 
-- 
2.11.0


             reply	other threads:[~2018-12-28 11:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-28 11:23 Charles Keepax [this message]
2018-12-28 11:55 ` [PATCH] regmap: irq: Make IRQ type support optional Charles Keepax
2018-12-28 12:16   ` Vaittinen, Matti
2019-01-03 17:22     ` Charles Keepax

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=20181228112358.5914-1-ckeepax@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox