Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1500122 > unrolled thread

[PATCH 2/2] HID: i2c-hid: exit if the IRQ is not valid

Started byBenjamin Tissoires <benjamin.tissoires@redhat.com>
First post2016-10-13 11:40 +0200
Last post2016-10-13 12:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] HID: i2c-hid: exit if the IRQ is not valid Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-10-13 11:40 +0200
    Re: [PATCH 2/2] HID: i2c-hid: exit if the IRQ is not valid Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-10-13 12:30 +0200

#1500122 — [PATCH 2/2] HID: i2c-hid: exit if the IRQ is not valid

FromBenjamin Tissoires <benjamin.tissoires@redhat.com>
Date2016-10-13 11:40 +0200
Subject[PATCH 2/2] HID: i2c-hid: exit if the IRQ is not valid
Message-ID<srKEx-1EP-7@gated-at.bofh.it>
From: David Arcari <darcari@redhat.com>

When i2c-core doesn't find the IRQ associated to the GPIO because
the gpiochip is not available, it assigns -EPROBE_DEFER to the irq.
We need to bail out there and on any other error in an IRQ.

Signed-off-by: David Arcari <darcari@redhat.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
 drivers/hid/i2c-hid/i2c-hid.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 4cd606c..fe6b4e0 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -956,6 +956,13 @@ static int i2c_hid_probe(struct i2c_client *client,
 		return -EINVAL;
 	}
 
+	if (client->irq < 0) {
+		if (client->irq != -EPROBE_DEFER)
+			dev_err(&client->dev,
+				"HID over i2c doesn't have a valid IRQ\n");
+		return client->irq;
+	}
+
 	ihid = kzalloc(sizeof(struct i2c_hid), GFP_KERNEL);
 	if (!ihid)
 		return -ENOMEM;
-- 
2.7.4

[toc] | [next] | [standalone]


#1500143

FromMika Westerberg <mika.westerberg@linux.intel.com>
Date2016-10-13 12:30 +0200
Message-ID<srLqW-2eM-29@gated-at.bofh.it>
In reply to#1500122
On Thu, Oct 13, 2016 at 11:30:45AM +0200, Benjamin Tissoires wrote:
> From: David Arcari <darcari@redhat.com>
> 
> When i2c-core doesn't find the IRQ associated to the GPIO because
> the gpiochip is not available, it assigns -EPROBE_DEFER to the irq.
> We need to bail out there and on any other error in an IRQ.
> 
> Signed-off-by: David Arcari <darcari@redhat.com>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web