* [PATCH] i2c: mux: reg: don't log an error for probe deferral
@ 2017-12-12 10:12 Alexander Sverdlin
2017-12-12 10:43 ` Peter Rosin
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Sverdlin @ 2017-12-12 10:12 UTC (permalink / raw)
To: linux-i2c; +Cc: Tomasz Bachorski, Wolfram Sang, Peter Rosin, Alexander Sverdlin
From: Tomasz Bachorski <tomasz.bachorski@nokia.com>
It's possible that i2c_mux_reg_probe_dt() could return -EPROBE_DEFER.
In that case, driver will request a probe deferral and an error
suggesting device tree parsing problem will be reported. This is
a pretty confusing information. Let's change the error handling,
so driver will be able to request probe deferral without logging
not related errors.
Signed-off-by: Tomasz Bachorski <tomasz.bachorski@nokia.com>
---
drivers/i2c/muxes/i2c-mux-reg.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c
index f6c9c3dc6cad..e0be96e77231 100644
--- a/drivers/i2c/muxes/i2c-mux-reg.c
+++ b/drivers/i2c/muxes/i2c-mux-reg.c
@@ -177,7 +177,9 @@ static int i2c_mux_reg_probe(struct platform_device *pdev)
sizeof(mux->data));
} else {
ret = i2c_mux_reg_probe_dt(mux, pdev);
- if (ret < 0) {
+ if (ret == -EPROBE_DEFER) {
+ return ret;
+ } else if (ret < 0) {
dev_err(&pdev->dev, "Error parsing device tree");
return ret;
}
--
2.13.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c: mux: reg: don't log an error for probe deferral
2017-12-12 10:12 [PATCH] i2c: mux: reg: don't log an error for probe deferral Alexander Sverdlin
@ 2017-12-12 10:43 ` Peter Rosin
0 siblings, 0 replies; 2+ messages in thread
From: Peter Rosin @ 2017-12-12 10:43 UTC (permalink / raw)
To: Alexander Sverdlin, linux-i2c; +Cc: Tomasz Bachorski, Wolfram Sang
On 2017-12-12 11:12, Alexander Sverdlin wrote:
> From: Tomasz Bachorski <tomasz.bachorski@nokia.com>
>
> It's possible that i2c_mux_reg_probe_dt() could return -EPROBE_DEFER.
> In that case, driver will request a probe deferral and an error
> suggesting device tree parsing problem will be reported. This is
> a pretty confusing information. Let's change the error handling,
> so driver will be able to request probe deferral without logging
> not related errors.
>
> Signed-off-by: Tomasz Bachorski <tomasz.bachorski@nokia.com>
> ---
> drivers/i2c/muxes/i2c-mux-reg.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c
> index f6c9c3dc6cad..e0be96e77231 100644
> --- a/drivers/i2c/muxes/i2c-mux-reg.c
> +++ b/drivers/i2c/muxes/i2c-mux-reg.c
> @@ -177,7 +177,9 @@ static int i2c_mux_reg_probe(struct platform_device *pdev)
> sizeof(mux->data));
> } else {
> ret = i2c_mux_reg_probe_dt(mux, pdev);
> - if (ret < 0) {
> + if (ret == -EPROBE_DEFER) {
> + return ret;
> + } else if (ret < 0) {
Please just add
if (ret == -EPROBE_DEFER)
return ret;
before the "if (ret < 0)" check. No need for "else" when you always
return in the "if" body.
Cheers,
Peter
> dev_err(&pdev->dev, "Error parsing device tree");
> return ret;
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-12 10:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12 10:12 [PATCH] i2c: mux: reg: don't log an error for probe deferral Alexander Sverdlin
2017-12-12 10:43 ` Peter Rosin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox