Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

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

Fixes: 325bec7157b3 ("mfd: tps6594: Add driver for TI TPS6594 PMIC")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/49f7cd8f-f7eb-40f1-91e8-291620c684df@kili.mountain
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Dan Carpenter and committed by
Lee Jones
cc5f2eb7 4b506480

+2 -2
+1 -1
drivers/mfd/tps6594-i2c.c
··· 222 222 223 223 match = of_match_device(tps6594_i2c_of_match_table, dev); 224 224 if (!match) 225 - return dev_err_probe(dev, PTR_ERR(match), "Failed to find matching chip ID\n"); 225 + return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); 226 226 tps->chip_id = (unsigned long)match->data; 227 227 228 228 crc8_populate_msb(tps6594_i2c_crc_table, TPS6594_CRC8_POLYNOMIAL);
+1 -1
drivers/mfd/tps6594-spi.c
··· 107 107 108 108 match = of_match_device(tps6594_spi_of_match_table, dev); 109 109 if (!match) 110 - return dev_err_probe(dev, PTR_ERR(match), "Failed to find matching chip ID\n"); 110 + return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); 111 111 tps->chip_id = (unsigned long)match->data; 112 112 113 113 crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL);