Skip to content

Commit 4ff39d6

Browse files
Francesco Lavrajic23
authored andcommitted
iio: accel: adxl380: fix handling of unavailable "INT1" interrupt
fwnode_irq_get_byname() returns a negative value on failure; if a negative value is returned, use it as `err` argument for dev_err_probe(). While at it, add a missing trailing newline to the dev_err_probe() error message. Fixes: df36de1 ("iio: accel: add ADXL380 driver") Signed-off-by: Francesco Lavra <flavra@baylibre.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent c34e2e2 commit 4ff39d6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/iio/accel/adxl380.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1784,9 +1784,9 @@ static int adxl380_config_irq(struct iio_dev *indio_dev)
17841784
st->int_map[1] = ADXL380_INT0_MAP1_REG;
17851785
} else {
17861786
st->irq = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT1");
1787-
if (st->irq > 0)
1788-
return dev_err_probe(st->dev, -ENODEV,
1789-
"no interrupt name specified");
1787+
if (st->irq < 0)
1788+
return dev_err_probe(st->dev, st->irq,
1789+
"no interrupt name specified\n");
17901790
st->int_map[0] = ADXL380_INT1_MAP0_REG;
17911791
st->int_map[1] = ADXL380_INT1_MAP1_REG;
17921792
}

0 commit comments

Comments
 (0)