summary refs log tree commit diff
path: root/drivers/i2c/muxes
diff options
context:
space:
mode:
authorPhil Reid <preid@electromag.com.au>2017-08-24 17:31:06 +0800
committerWolfram Sang <wsa@the-dreams.de>2017-10-28 23:43:10 +0200
commite460617e85db8af533c9f70c9ab94d4fa111b379 (patch)
tree7240467cc3a750d6877fc6ae8a42bd30416a065e /drivers/i2c/muxes
parent148baf1ddfb65019ee510ba2a76c2e7cd9752982 (diff)
downloadlinux-e460617e85db8af533c9f70c9ab94d4fa111b379.tar.gz
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>
Diffstat (limited to 'drivers/i2c/muxes')
-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)
 
 	for (c = 0; c < data->chip->nchans; c++) {
 		irq = irq_create_mapping(data->irq, c);
+		if (!irq) {
+			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);