linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] isa: Ensure number of irq matches number of base
@ 2022-08-18 16:28 William Breathitt Gray
  2022-08-18 16:28 ` [PATCH 1/6] isa: Introduce the module_isa_driver_with_irq helper macro William Breathitt Gray
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: William Breathitt Gray @ 2022-08-18 16:28 UTC (permalink / raw)
  To: linux-iio, linux-gpio
  Cc: linux-kernel, linus.walleij, brgl, William Breathitt Gray

Several ISA drivers support IRQ and call devm_request_irq() in their
device probe callbacks. These drivers typically provide an "irq" array
module parameter, which matches with the respective "base" array module
parameter, to specify what IRQ lines are used for each device. To reduce
code repetition, a module_isa_driver_with_irq helper macro is introduced
providing a check ensuring that the number of "irq" passed to the module
matches with the respective number of "base". The relevant ISA drivers
are updated accordingly to utilize the new module_isa_driver_with_irq
macro.

William Breathitt Gray (6):
  isa: Introduce the module_isa_driver_with_irq helper macro
  counter: 104-quad-8: Ensure number of irq matches number of base
  gpio: 104-dio-48e: Ensure number of irq matches number of base
  gpio: 104-idi-48: Ensure number of irq matches number of base
  gpio: 104-idio-16: Ensure number of irq matches number of base
  gpio: ws16c48: Ensure number of irq matches number of base

 drivers/counter/104-quad-8.c    |  5 ++--
 drivers/gpio/gpio-104-dio-48e.c |  5 ++--
 drivers/gpio/gpio-104-idi-48.c  |  5 ++--
 drivers/gpio/gpio-104-idio-16.c |  5 ++--
 drivers/gpio/gpio-ws16c48.c     |  5 ++--
 include/linux/isa.h             | 52 ++++++++++++++++++++++++++-------
 6 files changed, 57 insertions(+), 20 deletions(-)


base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868
-- 
2.37.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/6] isa: Introduce the module_isa_driver_with_irq helper macro
  2022-08-18 16:28 [PATCH 0/6] isa: Ensure number of irq matches number of base William Breathitt Gray
@ 2022-08-18 16:28 ` William Breathitt Gray
  2022-08-31 22:53   ` William Breathitt Gray
  2022-08-18 16:28 ` [PATCH 2/6] counter: 104-quad-8: Ensure number of irq matches number of base William Breathitt Gray
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: William Breathitt Gray @ 2022-08-18 16:28 UTC (permalink / raw)
  To: linux-iio, linux-gpio
  Cc: linux-kernel, linus.walleij, brgl, William Breathitt Gray

Several ISA drivers feature IRQ support that can configured via an "irq"
array module parameter. This array typically matches directly with the
respective "base" array module parameter. To reduce code repetition, a
module_isa_driver_with_irq helper macro is introduced to provide a check
ensuring that the number of "irq" passed to the module matches with the
respective number of "base".

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
---
 include/linux/isa.h | 52 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 42 insertions(+), 10 deletions(-)

diff --git a/include/linux/isa.h b/include/linux/isa.h
index e30963190968..4fbbf5e36e08 100644
--- a/include/linux/isa.h
+++ b/include/linux/isa.h
@@ -38,6 +38,32 @@ static inline void isa_unregister_driver(struct isa_driver *d)
 }
 #endif
 
+#define module_isa_driver_init(__isa_driver, __num_isa_dev) \
+static int __init __isa_driver##_init(void) \
+{ \
+	return isa_register_driver(&(__isa_driver), __num_isa_dev); \
+} \
+module_init(__isa_driver##_init)
+
+#define module_isa_driver_with_irq_init(__isa_driver, __num_isa_dev, __num_irq) \
+static int __init __isa_driver##_init(void) \
+{ \
+	if (__num_irq != __num_isa_dev) { \
+		pr_err("%s: Number of irq (%u) does not match number of base (%u)\n", \
+		       __isa_driver.driver.name, __num_irq, __num_isa_dev); \
+		return -EINVAL; \
+	} \
+	return isa_register_driver(&(__isa_driver), __num_isa_dev); \
+} \
+module_init(__isa_driver##_init)
+
+#define module_isa_driver_exit(__isa_driver) \
+static void __exit __isa_driver##_exit(void) \
+{ \
+	isa_unregister_driver(&(__isa_driver)); \
+} \
+module_exit(__isa_driver##_exit)
+
 /**
  * module_isa_driver() - Helper macro for registering a ISA driver
  * @__isa_driver: isa_driver struct
@@ -48,16 +74,22 @@ static inline void isa_unregister_driver(struct isa_driver *d)
  * use this macro once, and calling it replaces module_init and module_exit.
  */
 #define module_isa_driver(__isa_driver, __num_isa_dev) \
-static int __init __isa_driver##_init(void) \
-{ \
-	return isa_register_driver(&(__isa_driver), __num_isa_dev); \
-} \
-module_init(__isa_driver##_init); \
-static void __exit __isa_driver##_exit(void) \
-{ \
-	isa_unregister_driver(&(__isa_driver)); \
-} \
-module_exit(__isa_driver##_exit);
+module_isa_driver_init(__isa_driver, __num_isa_dev); \
+module_isa_driver_exit(__isa_driver)
+
+/**
+ * module_isa_driver_with_irq() - Helper macro for registering an ISA driver with irq
+ * @__isa_driver: isa_driver struct
+ * @__num_isa_dev: number of devices to register
+ * @__num_irq: number of IRQ to register
+ *
+ * Helper macro for ISA drivers with irq that do not do anything special in
+ * module init/exit. Each module may only use this macro once, and calling it
+ * replaces module_init and module_exit.
+ */
+#define module_isa_driver_with_irq(__isa_driver, __num_isa_dev, __num_irq) \
+module_isa_driver_with_irq_init(__isa_driver, __num_isa_dev, __num_irq); \
+module_isa_driver_exit(__isa_driver)
 
 /**
  * max_num_isa_dev() - Maximum possible number registered of an ISA device
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/6] counter: 104-quad-8: Ensure number of irq matches number of base
  2022-08-18 16:28 [PATCH 0/6] isa: Ensure number of irq matches number of base 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-18 16:28 ` 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
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: William Breathitt Gray @ 2022-08-18 16:28 UTC (permalink / raw)
  To: linux-iio, linux-gpio
  Cc: linux-kernel, linus.walleij, brgl, William Breathitt Gray

The 104-quad-8 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/counter/104-quad-8.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c
index 62c2b7ac4339..3f8d1910a9bb 100644
--- a/drivers/counter/104-quad-8.c
+++ b/drivers/counter/104-quad-8.c
@@ -28,7 +28,8 @@ module_param_hw_array(base, uint, ioport, &num_quad8, 0);
 MODULE_PARM_DESC(base, "ACCES 104-QUAD-8 base addresses");
 
 static unsigned int irq[max_num_isa_dev(QUAD8_EXTENT)];
-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-QUAD-8 interrupt line numbers");
 
 #define QUAD8_NUM_COUNTERS 8
@@ -1236,7 +1237,7 @@ static struct isa_driver quad8_driver = {
 	}
 };
 
-module_isa_driver(quad8_driver, num_quad8);
+module_isa_driver_with_irq(quad8_driver, num_quad8, num_irq);
 
 MODULE_AUTHOR("William Breathitt Gray <vilhelm.gray@gmail.com>");
 MODULE_DESCRIPTION("ACCES 104-QUAD-8 driver");
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/6] gpio: 104-dio-48e: Ensure number of irq matches number of base
  2022-08-18 16:28 [PATCH 0/6] isa: Ensure number of irq matches number of base 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-18 16:28 ` [PATCH 2/6] counter: 104-quad-8: Ensure number of irq matches number of base William Breathitt Gray
@ 2022-08-18 16:28 ` William Breathitt Gray
  2022-08-18 16:28 ` [PATCH 4/6] gpio: 104-idi-48: " William Breathitt Gray
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: William Breathitt Gray @ 2022-08-18 16:28 UTC (permalink / raw)
  To: linux-iio, linux-gpio
  Cc: linux-kernel, linus.walleij, brgl, William Breathitt Gray

The 104-dio-48e 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-dio-48e.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-104-dio-48e.c b/drivers/gpio/gpio-104-dio-48e.c
index a41551870759..8b5172802188 100644
--- a/drivers/gpio/gpio-104-dio-48e.c
+++ b/drivers/gpio/gpio-104-dio-48e.c
@@ -34,7 +34,8 @@ module_param_hw_array(base, uint, ioport, &num_dio48e, 0);
 MODULE_PARM_DESC(base, "ACCES 104-DIO-48E base addresses");
 
 static unsigned int irq[MAX_NUM_DIO48E];
-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-DIO-48E interrupt line numbers");
 
 #define DIO48E_NUM_PPI 2
@@ -358,7 +359,7 @@ static struct isa_driver dio48e_driver = {
 		.name = "104-dio-48e"
 	},
 };
-module_isa_driver(dio48e_driver, num_dio48e);
+module_isa_driver_with_irq(dio48e_driver, num_dio48e, num_irq);
 
 MODULE_AUTHOR("William Breathitt Gray <vilhelm.gray@gmail.com>");
 MODULE_DESCRIPTION("ACCES 104-DIO-48E GPIO driver");
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/6] gpio: 104-idi-48: Ensure number of irq matches number of base
  2022-08-18 16:28 [PATCH 0/6] isa: Ensure number of irq matches number of base William Breathitt Gray
                   ` (2 preceding siblings ...)
  2022-08-18 16:28 ` [PATCH 3/6] gpio: 104-dio-48e: " William Breathitt Gray
@ 2022-08-18 16:28 ` William Breathitt Gray
  2022-08-18 16:28 ` [PATCH 5/6] gpio: 104-idio-16: " William Breathitt Gray
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: William Breathitt Gray @ 2022-08-18 16:28 UTC (permalink / raw)
  To: linux-iio, linux-gpio
  Cc: linux-kernel, linus.walleij, brgl, William Breathitt Gray

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/6] gpio: 104-idio-16: Ensure number of irq matches number of base
  2022-08-18 16:28 [PATCH 0/6] isa: Ensure number of irq matches number of base William Breathitt Gray
                   ` (3 preceding siblings ...)
  2022-08-18 16:28 ` [PATCH 4/6] gpio: 104-idi-48: " William Breathitt Gray
@ 2022-08-18 16:28 ` 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
  6 siblings, 0 replies; 13+ messages in thread
From: William Breathitt Gray @ 2022-08-18 16:28 UTC (permalink / raw)
  To: linux-iio, linux-gpio
  Cc: linux-kernel, linus.walleij, brgl, William Breathitt Gray

The 104-idio-16 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-idio-16.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-104-idio-16.c b/drivers/gpio/gpio-104-idio-16.c
index 65a5f581d981..73d95b55a8c5 100644
--- a/drivers/gpio/gpio-104-idio-16.c
+++ b/drivers/gpio/gpio-104-idio-16.c
@@ -30,7 +30,8 @@ module_param_hw_array(base, uint, ioport, &num_idio_16, 0);
 MODULE_PARM_DESC(base, "ACCES 104-IDIO-16 base addresses");
 
 static unsigned int irq[MAX_NUM_IDIO_16];
-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-IDIO-16 interrupt line numbers");
 
 /**
@@ -333,7 +334,7 @@ static struct isa_driver idio_16_driver = {
 	},
 };
 
-module_isa_driver(idio_16_driver, num_idio_16);
+module_isa_driver_with_irq(idio_16_driver, num_idio_16, num_irq);
 
 MODULE_AUTHOR("William Breathitt Gray <vilhelm.gray@gmail.com>");
 MODULE_DESCRIPTION("ACCES 104-IDIO-16 GPIO driver");
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 6/6] gpio: ws16c48: Ensure number of irq matches number of base
  2022-08-18 16:28 [PATCH 0/6] isa: Ensure number of irq matches number of base William Breathitt Gray
                   ` (4 preceding siblings ...)
  2022-08-18 16:28 ` [PATCH 5/6] gpio: 104-idio-16: " William Breathitt Gray
@ 2022-08-18 16:28 ` William Breathitt Gray
  2022-08-31 12:35 ` [PATCH 0/6] isa: " Bartosz Golaszewski
  6 siblings, 0 replies; 13+ messages in thread
From: William Breathitt Gray @ 2022-08-18 16:28 UTC (permalink / raw)
  To: linux-iio, linux-gpio
  Cc: linux-kernel, linus.walleij, brgl, William Breathitt Gray

The ws16c48 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-ws16c48.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-ws16c48.c b/drivers/gpio/gpio-ws16c48.c
index b098f2dc196b..88410da91aaf 100644
--- a/drivers/gpio/gpio-ws16c48.c
+++ b/drivers/gpio/gpio-ws16c48.c
@@ -27,7 +27,8 @@ module_param_hw_array(base, uint, ioport, &num_ws16c48, 0);
 MODULE_PARM_DESC(base, "WinSystems WS16C48 base addresses");
 
 static unsigned int irq[MAX_NUM_WS16C48];
-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, "WinSystems WS16C48 interrupt line numbers");
 
 /**
@@ -497,7 +498,7 @@ static struct isa_driver ws16c48_driver = {
 	},
 };
 
-module_isa_driver(ws16c48_driver, num_ws16c48);
+module_isa_driver_with_irq(ws16c48_driver, num_ws16c48, num_irq);
 
 MODULE_AUTHOR("William Breathitt Gray <vilhelm.gray@gmail.com>");
 MODULE_DESCRIPTION("WinSystems WS16C48 GPIO driver");
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/6] isa: Ensure number of irq matches number of base
  2022-08-18 16:28 [PATCH 0/6] isa: Ensure number of irq matches number of base William Breathitt Gray
                   ` (5 preceding siblings ...)
  2022-08-18 16:28 ` [PATCH 6/6] gpio: ws16c48: " William Breathitt Gray
@ 2022-08-31 12:35 ` Bartosz Golaszewski
  2022-08-31 13:54   ` William Breathitt Gray
  6 siblings, 1 reply; 13+ messages in thread
From: Bartosz Golaszewski @ 2022-08-31 12:35 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: linux-iio, open list:GPIO SUBSYSTEM, Linux Kernel Mailing List,
	Linus Walleij

On Fri, Aug 19, 2022 at 1:11 AM William Breathitt Gray
<william.gray@linaro.org> wrote:
>
> Several ISA drivers support IRQ and call devm_request_irq() in their
> device probe callbacks. These drivers typically provide an "irq" array
> module parameter, which matches with the respective "base" array module
> parameter, to specify what IRQ lines are used for each device. To reduce
> code repetition, a module_isa_driver_with_irq helper macro is introduced
> providing a check ensuring that the number of "irq" passed to the module
> matches with the respective number of "base". The relevant ISA drivers
> are updated accordingly to utilize the new module_isa_driver_with_irq
> macro.
>
> William Breathitt Gray (6):
>   isa: Introduce the module_isa_driver_with_irq helper macro
>   counter: 104-quad-8: Ensure number of irq matches number of base
>   gpio: 104-dio-48e: Ensure number of irq matches number of base
>   gpio: 104-idi-48: Ensure number of irq matches number of base
>   gpio: 104-idio-16: Ensure number of irq matches number of base
>   gpio: ws16c48: Ensure number of irq matches number of base
>
>  drivers/counter/104-quad-8.c    |  5 ++--
>  drivers/gpio/gpio-104-dio-48e.c |  5 ++--
>  drivers/gpio/gpio-104-idi-48.c  |  5 ++--
>  drivers/gpio/gpio-104-idio-16.c |  5 ++--
>  drivers/gpio/gpio-ws16c48.c     |  5 ++--
>  include/linux/isa.h             | 52 ++++++++++++++++++++++++++-------
>  6 files changed, 57 insertions(+), 20 deletions(-)
>
>
> base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868
> --
> 2.37.2
>

Looks good to me, do you send your PRs directly to Linus? Do you want
me to take this through the GPIO tree?

Bart

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/6] isa: Ensure number of irq matches number of base
  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
  0 siblings, 1 reply; 13+ messages in thread
From: William Breathitt Gray @ 2022-08-31 13:54 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: open list:GPIO SUBSYSTEM, Linux Kernel Mailing List, Linus Walleij

[-- Attachment #1: Type: text/plain, Size: 2092 bytes --]

On Wed, Aug 31, 2022 at 02:35:51PM +0200, Bartosz Golaszewski wrote:
> On Fri, Aug 19, 2022 at 1:11 AM William Breathitt Gray
> <william.gray@linaro.org> wrote:
> >
> > Several ISA drivers support IRQ and call devm_request_irq() in their
> > device probe callbacks. These drivers typically provide an "irq" array
> > module parameter, which matches with the respective "base" array module
> > parameter, to specify what IRQ lines are used for each device. To reduce
> > code repetition, a module_isa_driver_with_irq helper macro is introduced
> > providing a check ensuring that the number of "irq" passed to the module
> > matches with the respective number of "base". The relevant ISA drivers
> > are updated accordingly to utilize the new module_isa_driver_with_irq
> > macro.
> >
> > William Breathitt Gray (6):
> >   isa: Introduce the module_isa_driver_with_irq helper macro
> >   counter: 104-quad-8: Ensure number of irq matches number of base
> >   gpio: 104-dio-48e: Ensure number of irq matches number of base
> >   gpio: 104-idi-48: Ensure number of irq matches number of base
> >   gpio: 104-idio-16: Ensure number of irq matches number of base
> >   gpio: ws16c48: Ensure number of irq matches number of base
> >
> >  drivers/counter/104-quad-8.c    |  5 ++--
> >  drivers/gpio/gpio-104-dio-48e.c |  5 ++--
> >  drivers/gpio/gpio-104-idi-48.c  |  5 ++--
> >  drivers/gpio/gpio-104-idio-16.c |  5 ++--
> >  drivers/gpio/gpio-ws16c48.c     |  5 ++--
> >  include/linux/isa.h             | 52 ++++++++++++++++++++++++++-------
> >  6 files changed, 57 insertions(+), 20 deletions(-)
> >
> >
> > base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868
> > --
> > 2.37.2
> >
> 
> Looks good to me, do you send your PRs directly to Linus? Do you want
> me to take this through the GPIO tree?
> 
> Bart

Hi Bart,

Would you take this through the GPIO tree? I'm planning on submitting
some more patches later for these GPIO drivers so it will be convenient
to keep all these changes within the same tree.

Thanks,

William Breathitt Gray

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/6] isa: Ensure number of irq matches number of base
  2022-08-31 13:54   ` William Breathitt Gray
@ 2022-08-31 14:00     ` Bartosz Golaszewski
  0 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2022-08-31 14:00 UTC (permalink / raw)
  To: William Breathitt Gray
  Cc: open list:GPIO SUBSYSTEM, Linux Kernel Mailing List, Linus Walleij

On Wed, Aug 31, 2022 at 3:54 PM William Breathitt Gray
<william.gray@linaro.org> wrote:
>
> On Wed, Aug 31, 2022 at 02:35:51PM +0200, Bartosz Golaszewski wrote:
> > On Fri, Aug 19, 2022 at 1:11 AM William Breathitt Gray
> > <william.gray@linaro.org> wrote:
> > >
> > > Several ISA drivers support IRQ and call devm_request_irq() in their
> > > device probe callbacks. These drivers typically provide an "irq" array
> > > module parameter, which matches with the respective "base" array module
> > > parameter, to specify what IRQ lines are used for each device. To reduce
> > > code repetition, a module_isa_driver_with_irq helper macro is introduced
> > > providing a check ensuring that the number of "irq" passed to the module
> > > matches with the respective number of "base". The relevant ISA drivers
> > > are updated accordingly to utilize the new module_isa_driver_with_irq
> > > macro.
> > >
> > > William Breathitt Gray (6):
> > >   isa: Introduce the module_isa_driver_with_irq helper macro
> > >   counter: 104-quad-8: Ensure number of irq matches number of base
> > >   gpio: 104-dio-48e: Ensure number of irq matches number of base
> > >   gpio: 104-idi-48: Ensure number of irq matches number of base
> > >   gpio: 104-idio-16: Ensure number of irq matches number of base
> > >   gpio: ws16c48: Ensure number of irq matches number of base
> > >
> > >  drivers/counter/104-quad-8.c    |  5 ++--
> > >  drivers/gpio/gpio-104-dio-48e.c |  5 ++--
> > >  drivers/gpio/gpio-104-idi-48.c  |  5 ++--
> > >  drivers/gpio/gpio-104-idio-16.c |  5 ++--
> > >  drivers/gpio/gpio-ws16c48.c     |  5 ++--
> > >  include/linux/isa.h             | 52 ++++++++++++++++++++++++++-------
> > >  6 files changed, 57 insertions(+), 20 deletions(-)
> > >
> > >
> > > base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868
> > > --
> > > 2.37.2
> > >
> >
> > Looks good to me, do you send your PRs directly to Linus? Do you want
> > me to take this through the GPIO tree?
> >
> > Bart
>
> Hi Bart,
>
> Would you take this through the GPIO tree? I'm planning on submitting
> some more patches later for these GPIO drivers so it will be convenient
> to keep all these changes within the same tree.
>
> Thanks,
>
> William Breathitt Gray

Sure, just leave your Acks on the first two patches.

Bart

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/6] isa: Introduce the module_isa_driver_with_irq helper macro
  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
  0 siblings, 1 reply; 13+ messages in thread
From: William Breathitt Gray @ 2022-08-31 22:53 UTC (permalink / raw)
  To: brgl; +Cc: linux-kernel, linus.walleij, linux-gpio

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

On Thu, Aug 18, 2022 at 12:28:10PM -0400, William Breathitt Gray wrote:
> Several ISA drivers feature IRQ support that can configured via an "irq"
> array module parameter. This array typically matches directly with the
> respective "base" array module parameter. To reduce code repetition, a
> module_isa_driver_with_irq helper macro is introduced to provide a check
> ensuring that the number of "irq" passed to the module matches with the
> respective number of "base".
> 
> Signed-off-by: William Breathitt Gray <william.gray@linaro.org>

Acked-by: William Breathitt Gray <william.gray@linaro.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/6] counter: 104-quad-8: Ensure number of irq matches number of base
  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
  0 siblings, 0 replies; 13+ messages in thread
From: William Breathitt Gray @ 2022-08-31 22:54 UTC (permalink / raw)
  To: brgl; +Cc: linux-kernel, linus.walleij, linux-gpio

[-- Attachment #1: Type: text/plain, Size: 563 bytes --]

On Thu, Aug 18, 2022 at 12:28:11PM -0400, William Breathitt Gray wrote:
> The 104-quad-8 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>

Acked-by: William Breathitt Gray <william.gray@linaro.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/6] isa: Introduce the module_isa_driver_with_irq helper macro
  2022-08-31 22:53   ` William Breathitt Gray
@ 2022-09-15  8:29     ` Bartosz Golaszewski
  0 siblings, 0 replies; 13+ messages in thread
From: Bartosz Golaszewski @ 2022-09-15  8:29 UTC (permalink / raw)
  To: William Breathitt Gray; +Cc: linux-kernel, linus.walleij, linux-gpio

On Thu, Sep 1, 2022 at 12:53 AM William Breathitt Gray
<william.gray@linaro.org> wrote:
>
> On Thu, Aug 18, 2022 at 12:28:10PM -0400, William Breathitt Gray wrote:
> > Several ISA drivers feature IRQ support that can configured via an "irq"
> > array module parameter. This array typically matches directly with the
> > respective "base" array module parameter. To reduce code repetition, a
> > module_isa_driver_with_irq helper macro is introduced to provide a check
> > ensuring that the number of "irq" passed to the module matches with the
> > respective number of "base".
> >
> > Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
>
> Acked-by: William Breathitt Gray <william.gray@linaro.org>

Series queued.

Bart

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-09-15  8:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 16:28 [PATCH 0/6] isa: Ensure number of irq matches number of base 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 ` [PATCH 4/6] gpio: 104-idi-48: " William Breathitt Gray
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

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).