Thread (8 messages) 8 messages, 2 authors, 2017-07-18
STALE3262d
Revisions (4)
  1. v5 [diff vs current]
  2. v7 [diff vs current]
  3. v8 current
  4. v9 [diff vs current]

[PATCH v8 5/9] i2c: mux: pca954x: Return error if irq_create_mapping fails

From: Phil Reid <hidden>
Date: 2017-07-18 08:19:40
Also in: linux-i2c, linux-pm
Subsystem: i2c muxes, i2c subsystem, the rest · Maintainers: Peter Rosin, Andi Shyti, Linus Torvalds

irq_create_mapping can return an error, report error to log and return.
Cleanup will occur inprobe function when an error is returned.

Suggested-by: Peter Rosin <redacted>
Signed-off-by: Phil Reid <redacted>
---
 drivers/i2c/muxes/i2c-mux-pca954x.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 9867720..0594775 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -309,6 +309,10 @@ static int pca954x_irq_setup(struct i2c_mux_core *muxc)
 
 	for (c = 0; c < data->chip->nchans; c++) {
 		irq = irq_create_mapping(data->irq, c);
+		if (irq <= 0) {
+			dev_err(&client->dev, "failed irq create map\n");
+			return -EINVAL;
+		}
 		irq_set_chip_data(irq, data);
 		irq_set_chip_and_handler(irq, &pca954x_irq_chip,
 			handle_simple_irq);
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help