From: Dan Carpenter Date: Thu, 25 May 2023 09:03:45 +0000 (+0300) Subject: mfd: tps6594: Fix an error code in probe() X-Git-Tag: v6.6.7~2453^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc5f2eb7ce1190c163d309146fe236e2fa2e6c68;p=platform%2Fkernel%2Flinux-starfive.git 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 Link: https://lore.kernel.org/r/49f7cd8f-f7eb-40f1-91e8-291620c684df@kili.mountain Signed-off-by: Lee Jones --- diff --git a/drivers/mfd/tps6594-i2c.c b/drivers/mfd/tps6594-i2c.c index 449d5c6..50a3cd0 100644 --- a/drivers/mfd/tps6594-i2c.c +++ b/drivers/mfd/tps6594-i2c.c @@ -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); diff --git a/drivers/mfd/tps6594-spi.c b/drivers/mfd/tps6594-spi.c index a938a19..f4b4f37 100644 --- a/drivers/mfd/tps6594-spi.c +++ b/drivers/mfd/tps6594-spi.c @@ -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);