Commit e460617e authored by Phil Reid's avatar Phil Reid Committed by Wolfram Sang

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: default avatarPeter Rosin <peda@axentia.se>
Acked-by: default avatarPeter Rosin <peda@axentia.se>
Signed-off-by: default avatarPhil Reid <preid@electromag.com.au>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 148baf1d
...@@ -277,6 +277,10 @@ static int pca954x_irq_setup(struct i2c_mux_core *muxc) ...@@ -277,6 +277,10 @@ static int pca954x_irq_setup(struct i2c_mux_core *muxc)
for (c = 0; c < data->chip->nchans; c++) { for (c = 0; c < data->chip->nchans; c++) {
irq = irq_create_mapping(data->irq, 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_data(irq, data);
irq_set_chip_and_handler(irq, &pca954x_irq_chip, irq_set_chip_and_handler(irq, &pca954x_irq_chip,
handle_simple_irq); handle_simple_irq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment