From: William Breathitt Gray <william.gray@linaro.org>
To: linux-iio@vger.kernel.or, linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linus.walleij@linaro.org,
brgl@bgdev.pl, William Breathitt Gray <william.gray@linaro.org>
Subject: [PATCH 4/6] gpio: 104-idi-48: Ensure number of irq matches number of base
Date: Thu, 18 Aug 2022 12:28:13 -0400 [thread overview]
Message-ID: <0b7dbb8b35bc2b685fae5ce66ccee5b7c4a1fdc6.1660839809.git.william.gray@linaro.org> (raw)
In-Reply-To: <cover.1660839809.git.william.gray@linaro.org>
The 104-idi-48 module calls devm_request_irq() for each device. If the
number of irq passed to the module does not match the number of base, a
default value of 0 is passed to devm_request_irq(). IRQ 0 is probably
not what the user wants, so utilize the module_isa_driver_with_irq macro
to ensure the number of irq matches the number of base.
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
---
drivers/gpio/gpio-104-idi-48.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-104-idi-48.c b/drivers/gpio/gpio-104-idi-48.c
index 40be76efeed7..2b0256eefb70 100644
--- a/drivers/gpio/gpio-104-idi-48.c
+++ b/drivers/gpio/gpio-104-idi-48.c
@@ -34,7 +34,8 @@ module_param_hw_array(base, uint, ioport, &num_idi_48, 0);
MODULE_PARM_DESC(base, "ACCES 104-IDI-48 base addresses");
static unsigned int irq[MAX_NUM_IDI_48];
-module_param_hw_array(irq, uint, irq, NULL, 0);
+static unsigned int num_irq;
+module_param_hw_array(irq, uint, irq, &num_irq, 0);
MODULE_PARM_DESC(irq, "ACCES 104-IDI-48 interrupt line numbers");
/**
@@ -300,7 +301,7 @@ static struct isa_driver idi_48_driver = {
.name = "104-idi-48"
},
};
-module_isa_driver(idi_48_driver, num_idi_48);
+module_isa_driver_with_irq(idi_48_driver, num_idi_48, num_irq);
MODULE_AUTHOR("William Breathitt Gray <vilhelm.gray@gmail.com>");
MODULE_DESCRIPTION("ACCES 104-IDI-48 GPIO driver");
--
2.37.2
next prev parent reply other threads:[~2022-08-18 23:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-18 16:28 [PATCH 0/6] isa: " William Breathitt Gray
2022-08-18 16:28 ` [PATCH 1/6] isa: Introduce the module_isa_driver_with_irq helper macro William Breathitt Gray
2022-08-31 22:53 ` William Breathitt Gray
2022-09-15 8:29 ` Bartosz Golaszewski
2022-08-18 16:28 ` [PATCH 2/6] counter: 104-quad-8: Ensure number of irq matches number of base William Breathitt Gray
2022-08-31 22:54 ` William Breathitt Gray
2022-08-18 16:28 ` [PATCH 3/6] gpio: 104-dio-48e: " William Breathitt Gray
2022-08-18 16:28 ` William Breathitt Gray [this message]
2022-08-18 16:28 ` [PATCH 5/6] gpio: 104-idio-16: " William Breathitt Gray
2022-08-18 16:28 ` [PATCH 6/6] gpio: ws16c48: " William Breathitt Gray
2022-08-31 12:35 ` [PATCH 0/6] isa: " Bartosz Golaszewski
2022-08-31 13:54 ` William Breathitt Gray
2022-08-31 14:00 ` Bartosz Golaszewski
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=0b7dbb8b35bc2b685fae5ce66ccee5b7c4a1fdc6.1660839809.git.william.gray@linaro.org \
--to=william.gray@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.or \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®