* [RESEND PATCH 0/2] STMFX chip init couple of fixes
@ 2023-04-12 10:55 Amelie Delaunay
2023-04-12 10:55 ` [RESEND PATCH 1/2] mfd: stmfx: Fix error path in stmfx_chip_init Amelie Delaunay
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Amelie Delaunay @ 2023-04-12 10:55 UTC (permalink / raw)
To: Lee Jones, Maxime Coquelin, Alexandre Torgue
Cc: linux-stm32, linux-arm-kernel, linux-kernel, Amelie Delaunay
This series fixes the behavior of stm32_chip_init function in case
of errors.
Amelie Delaunay (2):
mfd: stmfx: Fix error path in stmfx_chip_init
mfd: stmfx: Nullify stmfx->vdd in case of error
drivers/mfd/stmfx.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RESEND PATCH 1/2] mfd: stmfx: Fix error path in stmfx_chip_init
2023-04-12 10:55 [RESEND PATCH 0/2] STMFX chip init couple of fixes Amelie Delaunay
@ 2023-04-12 10:55 ` Amelie Delaunay
2023-04-12 10:55 ` [RESEND PATCH 2/2] mfd: stmfx: Nullify stmfx->vdd in case of error Amelie Delaunay
2023-06-09 9:25 ` [RESEND PATCH 0/2] STMFX chip init couple of fixes Amelie Delaunay
2 siblings, 0 replies; 6+ messages in thread
From: Amelie Delaunay @ 2023-04-12 10:55 UTC (permalink / raw)
To: Lee Jones, Maxime Coquelin, Alexandre Torgue
Cc: linux-stm32, linux-arm-kernel, linux-kernel, Amelie Delaunay
In error path, disable vdd regulator if it exists, but don't overload ret.
Because if regulator_disable() is successful, stmfx_chip_init will exit
successfully while chip init failed.
Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver")
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
---
drivers/mfd/stmfx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index e281971ba54e..bfe89df27611 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -387,7 +387,7 @@ static int stmfx_chip_init(struct i2c_client *client)
err:
if (stmfx->vdd)
- return regulator_disable(stmfx->vdd);
+ regulator_disable(stmfx->vdd);
return ret;
}
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RESEND PATCH 2/2] mfd: stmfx: Nullify stmfx->vdd in case of error
2023-04-12 10:55 [RESEND PATCH 0/2] STMFX chip init couple of fixes Amelie Delaunay
2023-04-12 10:55 ` [RESEND PATCH 1/2] mfd: stmfx: Fix error path in stmfx_chip_init Amelie Delaunay
@ 2023-04-12 10:55 ` Amelie Delaunay
2023-06-09 9:25 ` [RESEND PATCH 0/2] STMFX chip init couple of fixes Amelie Delaunay
2 siblings, 0 replies; 6+ messages in thread
From: Amelie Delaunay @ 2023-04-12 10:55 UTC (permalink / raw)
To: Lee Jones, Maxime Coquelin, Alexandre Torgue
Cc: linux-stm32, linux-arm-kernel, linux-kernel, Amelie Delaunay
Nullify stmfx->vdd in case devm_regulator_get_optional() returns an error.
And simplify code by returning an error only if return code is not -ENODEV,
which means there is no vdd regulator and it is not an issue.
Fixes: d75846ed08e6 ("mfd: stmfx: Fix dev_err_probe() call in stmfx_chip_init()")
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
---
drivers/mfd/stmfx.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index bfe89df27611..76188212c66e 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -330,9 +330,8 @@ static int stmfx_chip_init(struct i2c_client *client)
stmfx->vdd = devm_regulator_get_optional(&client->dev, "vdd");
ret = PTR_ERR_OR_ZERO(stmfx->vdd);
if (ret) {
- if (ret == -ENODEV)
- stmfx->vdd = NULL;
- else
+ stmfx->vdd = NULL;
+ if (ret != -ENODEV)
return dev_err_probe(&client->dev, ret, "Failed to get VDD regulator\n");
}
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH 0/2] STMFX chip init couple of fixes
2023-04-12 10:55 [RESEND PATCH 0/2] STMFX chip init couple of fixes Amelie Delaunay
2023-04-12 10:55 ` [RESEND PATCH 1/2] mfd: stmfx: Fix error path in stmfx_chip_init Amelie Delaunay
2023-04-12 10:55 ` [RESEND PATCH 2/2] mfd: stmfx: Nullify stmfx->vdd in case of error Amelie Delaunay
@ 2023-06-09 9:25 ` Amelie Delaunay
2 siblings, 0 replies; 6+ messages in thread
From: Amelie Delaunay @ 2023-06-09 9:25 UTC (permalink / raw)
To: Lee Jones, Maxime Coquelin, Alexandre Torgue
Cc: linux-stm32, linux-arm-kernel, linux-kernel
Kind reminder on this series, pending for almost 3 months.
Thanks,
Amelie
On 4/12/23 12:55, Amelie Delaunay wrote:
> This series fixes the behavior of stm32_chip_init function in case
> of errors.
>
> Amelie Delaunay (2):
> mfd: stmfx: Fix error path in stmfx_chip_init
> mfd: stmfx: Nullify stmfx->vdd in case of error
>
> drivers/mfd/stmfx.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RESEND PATCH 2/2] mfd: stmfx: Nullify stmfx->vdd in case of error
2023-06-09 9:28 [RESEND PATCH 1/2] mfd: stmfx: Fix error path in stmfx_chip_init Amelie Delaunay
@ 2023-06-09 9:28 ` Amelie Delaunay
2023-06-15 14:05 ` Lee Jones
0 siblings, 1 reply; 6+ messages in thread
From: Amelie Delaunay @ 2023-06-09 9:28 UTC (permalink / raw)
To: Lee Jones, Maxime Coquelin, Alexandre Torgue, Liam Girdwood,
Mark Brown, Amelie Delaunay
Cc: Amelie Delaunay, linux-stm32, linux-arm-kernel, linux-kernel
Nullify stmfx->vdd in case devm_regulator_get_optional() returns an error.
And simplify code by returning an error only if return code is not -ENODEV,
which means there is no vdd regulator and it is not an issue.
Fixes: d75846ed08e6 ("mfd: stmfx: Fix dev_err_probe() call in stmfx_chip_init()")
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
---
drivers/mfd/stmfx.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index 54cc902cb578..c02cbd9c2f5d 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -330,9 +330,8 @@ static int stmfx_chip_init(struct i2c_client *client)
stmfx->vdd = devm_regulator_get_optional(&client->dev, "vdd");
ret = PTR_ERR_OR_ZERO(stmfx->vdd);
if (ret) {
- if (ret == -ENODEV)
- stmfx->vdd = NULL;
- else
+ stmfx->vdd = NULL;
+ if (ret != -ENODEV)
return dev_err_probe(&client->dev, ret, "Failed to get VDD regulator\n");
}
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RESEND PATCH 2/2] mfd: stmfx: Nullify stmfx->vdd in case of error
2023-06-09 9:28 ` [RESEND PATCH 2/2] mfd: stmfx: Nullify stmfx->vdd in case of error Amelie Delaunay
@ 2023-06-15 14:05 ` Lee Jones
0 siblings, 0 replies; 6+ messages in thread
From: Lee Jones @ 2023-06-15 14:05 UTC (permalink / raw)
To: Amelie Delaunay
Cc: Maxime Coquelin, Alexandre Torgue, Liam Girdwood, Mark Brown,
Amelie Delaunay, linux-stm32, linux-arm-kernel, linux-kernel
On Fri, 09 Jun 2023, Amelie Delaunay wrote:
> Nullify stmfx->vdd in case devm_regulator_get_optional() returns an error.
> And simplify code by returning an error only if return code is not -ENODEV,
> which means there is no vdd regulator and it is not an issue.
>
> Fixes: d75846ed08e6 ("mfd: stmfx: Fix dev_err_probe() call in stmfx_chip_init()")
> Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
> ---
> drivers/mfd/stmfx.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Applied, thanks
--
Lee Jones [李琼斯]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-06-15 14:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-12 10:55 [RESEND PATCH 0/2] STMFX chip init couple of fixes Amelie Delaunay
2023-04-12 10:55 ` [RESEND PATCH 1/2] mfd: stmfx: Fix error path in stmfx_chip_init Amelie Delaunay
2023-04-12 10:55 ` [RESEND PATCH 2/2] mfd: stmfx: Nullify stmfx->vdd in case of error Amelie Delaunay
2023-06-09 9:25 ` [RESEND PATCH 0/2] STMFX chip init couple of fixes Amelie Delaunay
-- strict thread matches above, loose matches on Subject: below --
2023-06-09 9:28 [RESEND PATCH 1/2] mfd: stmfx: Fix error path in stmfx_chip_init Amelie Delaunay
2023-06-09 9:28 ` [RESEND PATCH 2/2] mfd: stmfx: Nullify stmfx->vdd in case of error Amelie Delaunay
2023-06-15 14:05 ` 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).