[PATCH -next] hid: cp2112: Use irq_get_trigger_type() helper

Jinjie Ruan posted 1 patch 2 months, 2 weeks ago
drivers/hid/hid-cp2112.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
[PATCH -next] hid: cp2112: Use irq_get_trigger_type() helper
Posted by Jinjie Ruan 2 months, 2 weeks ago
Use irq_get_trigger_type() to replace irq_get_irq_data() and then
irqd_get_trigger_type(), if the irq data is NULL it will return 0.

No functional changed.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/hid/hid-cp2112.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index 20a0d1315d90..dae2b84a1490 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -1094,7 +1094,6 @@ static void cp2112_gpio_poll_callback(struct work_struct *work)
 {
 	struct cp2112_device *dev = container_of(work, struct cp2112_device,
 						 gpio_poll_worker.work);
-	struct irq_data *d;
 	u8 gpio_mask;
 	u32 irq_type;
 	int irq, virq, ret;
@@ -1111,12 +1110,10 @@ static void cp2112_gpio_poll_callback(struct work_struct *work)
 		if (!irq)
 			continue;
 
-		d = irq_get_irq_data(irq);
-		if (!d)
+		irq_type = irq_get_trigger_type(irq);
+		if (!irq_type)
 			continue;
 
-		irq_type = irqd_get_trigger_type(d);
-
 		if (gpio_mask & BIT(virq)) {
 			/* Level High */
 
-- 
2.34.1
Re: [PATCH -next] hid: cp2112: Use irq_get_trigger_type() helper
Posted by Benjamin Tissoires 2 months, 2 weeks ago
On Fri, 13 Sep 2024 15:46:32 +0800, Jinjie Ruan wrote:
> Use irq_get_trigger_type() to replace irq_get_irq_data() and then
> irqd_get_trigger_type(), if the irq data is NULL it will return 0.
> 
> No functional changed.
> 
> 

Applied to hid/hid.git (for-6.12/cp2112), thanks!

[1/1] hid: cp2112: Use irq_get_trigger_type() helper
      https://git.kernel.org/hid/hid/c/e9a081c80cb3

Cheers,
-- 
Benjamin Tissoires <bentiss@kernel.org>