Skip to contentSkip to conversation

mmc: slot-gpio: Use irq_handler_t type

PATCH In review Andy Shevchenko 3 participants 3 messages Apr 10, 2024 – Apr 25, 2024 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: slot-gpio: Use irq_handler_t type

The irq_handler_t is already defined globally, let's use it in slot-gpio code.

---
 drivers/mmc/core/slot-gpio.c  | 5 ++---
 include/linux/mmc/slot-gpio.h | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/mmc/core/slot-gpio.c +2 -3
index 39f45c2b6de8..8e4750558101 100644
@@ -19,7 +19,7 @@
 struct mmc_gpio {
 	struct gpio_desc *ro_gpio;
 	struct gpio_desc *cd_gpio;
-	irqreturn_t (*cd_gpio_isr)(int irq, void *dev_id);
+	irq_handler_t cd_gpio_isr;
 	char *ro_label;
 	char *cd_label;
 	u32 cd_debounce_delay_ms;
@@ -162,8 +162,7 @@ EXPORT_SYMBOL(mmc_gpio_set_cd_wake);
 /* Register an alternate interrupt service routine for
  * the card-detect GPIO.
  */
-void mmc_gpio_set_cd_isr(struct mmc_host *host,
-			 irqreturn_t (*isr)(int irq, void *dev_id))
+void mmc_gpio_set_cd_isr(struct mmc_host *host, irq_handler_t isr)
 {
 	struct mmc_gpio *ctx = host->slot.handler_priv;
 
include/linux/mmc/slot-gpio.h +2 -3
index 5d3d15e97868..3e4d4836a2bb 100644
@@ -8,8 +8,8 @@
 #ifndef MMC_SLOT_GPIO_H
 #define MMC_SLOT_GPIO_H
 
+#include <linux/interrupt.h>
 #include <linux/types.h>
-#include <linux/irqreturn.h>
 
 struct mmc_host;
 
@@ -21,8 +21,7 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
 			 unsigned int debounce);
 int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
 			 unsigned int idx, unsigned int debounce);
-void mmc_gpio_set_cd_isr(struct mmc_host *host,
-			 irqreturn_t (*isr)(int irq, void *dev_id));
+void mmc_gpio_set_cd_isr(struct mmc_host *host, irq_handler_t isr);
 int mmc_gpio_set_cd_wake(struct mmc_host *host, bool on);
 void mmc_gpiod_request_cd_irq(struct mmc_host *host);
 bool mmc_can_gpio_cd(struct mmc_host *host);
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
Reviewed-by on v1 1/1
#1 lore raw

Am Mittwoch, 10. April 2024, 21:56:18 CEST schrieb Andy Shevchenko:

Quoted 4 lines

The irq_handler_t is already defined globally, let's use it in slot-gpio code.

Looks good to me:

Quoted 53 lines
---
 drivers/mmc/core/slot-gpio.c  | 5 ++---
 include/linux/mmc/slot-gpio.h | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/mmc/core/slot-gpio.c +2 -3
index 39f45c2b6de8..8e4750558101 100644
@@ -19,7 +19,7 @@
 struct mmc_gpio {
 	struct gpio_desc *ro_gpio;
 	struct gpio_desc *cd_gpio;
-	irqreturn_t (*cd_gpio_isr)(int irq, void *dev_id);
+	irq_handler_t cd_gpio_isr;
 	char *ro_label;
 	char *cd_label;
 	u32 cd_debounce_delay_ms;
@@ -162,8 +162,7 @@ EXPORT_SYMBOL(mmc_gpio_set_cd_wake);
 /* Register an alternate interrupt service routine for
  * the card-detect GPIO.
  */
-void mmc_gpio_set_cd_isr(struct mmc_host *host,
-			 irqreturn_t (*isr)(int irq, void *dev_id))
+void mmc_gpio_set_cd_isr(struct mmc_host *host, irq_handler_t isr)
 {
 	struct mmc_gpio *ctx = host->slot.handler_priv;
 
include/linux/mmc/slot-gpio.h +2 -3
index 5d3d15e97868..3e4d4836a2bb 100644
@@ -8,8 +8,8 @@
 #ifndef MMC_SLOT_GPIO_H
 #define MMC_SLOT_GPIO_H
 
+#include <linux/interrupt.h>
 #include <linux/types.h>
-#include <linux/irqreturn.h>
 
 struct mmc_host;
 
@@ -21,8 +21,7 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
 			 unsigned int debounce);
 int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
 			 unsigned int idx, unsigned int debounce);
-void mmc_gpio_set_cd_isr(struct mmc_host *host,
-			 irqreturn_t (*isr)(int irq, void *dev_id));
+void mmc_gpio_set_cd_isr(struct mmc_host *host, irq_handler_t isr);
 int mmc_gpio_set_cd_wake(struct mmc_host *host, bool on);
 void mmc_gpiod_request_cd_irq(struct mmc_host *host);
 bool mmc_can_gpio_cd(struct mmc_host *host);
Signature · 4 lines
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
#2 lore raw
In reply to Andy Shevchenko
Quoted 5 lines · Andy Shevchenko

The irq_handler_t is already defined globally, let's use it in slot-gpio code.

Applied for next, thanks!

Kind regards
Uffe

Quoted 55 lines
---
 drivers/mmc/core/slot-gpio.c  | 5 ++---
 include/linux/mmc/slot-gpio.h | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/mmc/core/slot-gpio.c +2 -3
index 39f45c2b6de8..8e4750558101 100644
@@ -19,7 +19,7 @@
 struct mmc_gpio {
        struct gpio_desc *ro_gpio;
        struct gpio_desc *cd_gpio;
-       irqreturn_t (*cd_gpio_isr)(int irq, void *dev_id);
+       irq_handler_t cd_gpio_isr;
        char *ro_label;
        char *cd_label;
        u32 cd_debounce_delay_ms;
@@ -162,8 +162,7 @@ EXPORT_SYMBOL(mmc_gpio_set_cd_wake);
 /* Register an alternate interrupt service routine for
  * the card-detect GPIO.
  */
-void mmc_gpio_set_cd_isr(struct mmc_host *host,
-                        irqreturn_t (*isr)(int irq, void *dev_id))
+void mmc_gpio_set_cd_isr(struct mmc_host *host, irq_handler_t isr)
 {
        struct mmc_gpio *ctx = host->slot.handler_priv;
 
include/linux/mmc/slot-gpio.h +2 -4
index 5d3d15e97868..3e4d4836a2bb 100644
@@ -8,8 +8,8 @@
 #ifndef MMC_SLOT_GPIO_H
 #define MMC_SLOT_GPIO_H
 
+#include <linux/interrupt.h>
 #include <linux/types.h>
-#include <linux/irqreturn.h>
 
 struct mmc_host;
 
@@ -21,8 +21,7 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
                         unsigned int debounce);
 int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id,
                         unsigned int idx, unsigned int debounce);
-void mmc_gpio_set_cd_isr(struct mmc_host *host,
-                        irqreturn_t (*isr)(int irq, void *dev_id));
+void mmc_gpio_set_cd_isr(struct mmc_host *host, irq_handler_t isr);
 int mmc_gpio_set_cd_wake(struct mmc_host *host, bool on);
 void mmc_gpiod_request_cd_irq(struct mmc_host *host);
 bool mmc_can_gpio_cd(struct mmc_host *host);
--

2.43.0.rc1.1336.g36b5255a03ac