From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: linus.walleij@linaro.org
Cc: linux@rasmusvillemoes.dk, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org,
William Breathitt Gray <vilhelm.gray@gmail.com>
Subject: [PATCH 2/6] gpio: 104-idi-48e: Mask the read inputs for get_multiple
Date: Mon, 22 Oct 2018 21:09:16 +0900 [thread overview]
Message-ID: <7f7c7bb8dc10bb315ca03860cc24230bfc5370d8.1540209293.git.vilhelm.gray@gmail.com> (raw)
In-Reply-To: <cover.1540209293.git.vilhelm.gray@gmail.com>
This patch masks the read inputs with the word mask in order to ensure
only requested input states are returned in the bits array.
Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
---
drivers/gpio/gpio-104-idi-48.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-104-idi-48.c b/drivers/gpio/gpio-104-idi-48.c
index 2c9738adb3a6..88dc6f2449f6 100644
--- a/drivers/gpio/gpio-104-idi-48.c
+++ b/drivers/gpio/gpio-104-idi-48.c
@@ -128,7 +128,7 @@ static int idi_48_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask,
port_state = inb(idi48gpio->base + ports[i]);
/* store acquired bits at respective bits array offset */
- bits[word_index] |= port_state << word_offset;
+ bits[word_index] |= (port_state << word_offset) & word_mask;
}
return 0;
--
2.19.1
next prev parent reply other threads:[~2018-10-22 12:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-22 12:08 [PATCH 0/6] Mask read inputs for get_multiple callbacks William Breathitt Gray
2018-10-22 12:08 ` [PATCH 1/6] gpio: 104-dio-48e: Mask read inputs for get_multiple William Breathitt Gray
2018-10-22 12:09 ` William Breathitt Gray [this message]
2018-10-22 12:09 ` [PATCH 3/6] gpio: gpio-mm: " William Breathitt Gray
2018-10-22 12:09 ` [PATCH 4/6] gpio: ws16c48: " William Breathitt Gray
2018-10-22 12:10 ` [PATCH 5/6] gpio: pci-idio-16: " William Breathitt Gray
2018-10-22 12:10 ` [PATCH 6/6] gpio: pcie-idio-24: " William Breathitt Gray
2018-10-31 9:00 ` [PATCH 0/6] Mask read inputs for get_multiple callbacks Linus Walleij
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=7f7c7bb8dc10bb315ca03860cc24230bfc5370d8.1540209293.git.vilhelm.gray@gmail.com \
--to=vilhelm.gray@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
/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;
as well as URLs for NNTP newsgroup(s).