* [PATCH] mfd: tps6594: Fix an error code in probe()
@ 2023-05-25 9:03 Dan Carpenter
2023-06-02 8:21 ` Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2023-05-25 9:03 UTC (permalink / raw)
To: Julien Panis; +Cc: Lee Jones, linux-kernel, kernel-janitors
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>
---
drivers/mfd/tps6594-i2c.c | 2 +-
drivers/mfd/tps6594-spi.c | 2 +-
2 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/tps6594-i2c.c b/drivers/mfd/tps6594-i2c.c
index 449d5c61bc9f..50a3cd03b3b0 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 a938a191744f..f4b4f37f957f 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);
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mfd: tps6594: Fix an error code in probe()
2023-05-25 9:03 [PATCH] mfd: tps6594: Fix an error code in probe() Dan Carpenter
@ 2023-06-02 8:21 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2023-06-02 8:21 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Julien Panis, linux-kernel, kernel-janitors
On Thu, 25 May 2023, Dan Carpenter wrote:
> 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>
> ---
> drivers/mfd/tps6594-i2c.c | 2 +-
> drivers/mfd/tps6594-spi.c | 2 +-
> 2 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-02 8:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-25 9:03 [PATCH] mfd: tps6594: Fix an error code in probe() Dan Carpenter
2023-06-02 8:21 ` Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).