Re: [PATCH] i2c: mux: reg: don't log an error for probe deferral

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2017-12-12 11:12, Alexander Sverdlin wrote:
> From: Tomasz Bachorski <tomasz.bachorski@xxxxxxxxx>
> 
> 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@xxxxxxxxx>
> ---
>  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;
>  		}
> 




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux