Commit cc5f2eb7 authored by Dan Carpenter's avatar Dan Carpenter Committed by Lee Jones

mfd: tps6594: Fix an error code in probe()

These error paths accidentally return success when they should return
-EINVAL.

Fixes: 325bec71 ("mfd: tps6594: Add driver for TI TPS6594 PMIC")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/49f7cd8f-f7eb-40f1-91e8-291620c684df@kili.mountainSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 4b506480
......@@ -222,7 +222,7 @@ static int tps6594_i2c_probe(struct i2c_client *client)
match = of_match_device(tps6594_i2c_of_match_table, dev);
if (!match)
return dev_err_probe(dev, PTR_ERR(match), "Failed to find matching chip ID\n");
return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n");
tps->chip_id = (unsigned long)match->data;
crc8_populate_msb(tps6594_i2c_crc_table, TPS6594_CRC8_POLYNOMIAL);
......
......@@ -107,7 +107,7 @@ static int tps6594_spi_probe(struct spi_device *spi)
match = of_match_device(tps6594_spi_of_match_table, dev);
if (!match)
return dev_err_probe(dev, PTR_ERR(match), "Failed to find matching chip ID\n");
return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n");
tps->chip_id = (unsigned long)match->data;
crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL);
......
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