Skip to content

Commit

Permalink
i2c: mux: pca954x: Return error if irq_create_mapping fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Phil Reid authored and Wolfram Sang committed Oct 28, 2017
1 parent 148baf1 commit e460617
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/i2c/muxes/i2c-mux-pca954x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e460617

Please sign in to comment.