aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Reid <preid@electromag.com.au>2017-08-24 05:31:06 -0400
committerWolfram Sang <wsa@the-dreams.de>2017-10-28 17:43:10 -0400
commite460617e85db8af533c9f70c9ab94d4fa111b379 (patch)
tree7240467cc3a750d6877fc6ae8a42bd30416a065e
parent148baf1ddfb65019ee510ba2a76c2e7cd9752982 (diff)
i2c: mux: pca954x: Return error if irq_create_mapping fails
irq_create_mapping can return an error, report error to log and return. Cleanup will occur in the probe function when an error is returned. Suggested-by: Peter Rosin <peda@axentia.se> Acked-by: Peter Rosin <peda@axentia.se> Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/i2c/muxes/i2c-mux-pca954x.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 14aee65298f7..2ca068d8b92d 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -277,6 +277,10 @@ static int pca954x_irq_setup(struct i2c_mux_core *muxc)
277 277
278 for (c = 0; c < data->chip->nchans; c++) { 278 for (c = 0; c < data->chip->nchans; c++) {
279 irq = irq_create_mapping(data->irq, c); 279 irq = irq_create_mapping(data->irq, c);
280 if (!irq) {
281 dev_err(&client->dev, "failed irq create map\n");
282 return -EINVAL;
283 }
280 irq_set_chip_data(irq, data); 284 irq_set_chip_data(irq, data);
281 irq_set_chip_and_handler(irq, &pca954x_irq_chip, 285 irq_set_chip_and_handler(irq, &pca954x_irq_chip,
282 handle_simple_irq); 286 handle_simple_irq);