[RFC PATCH 07/13] mux: mmio: Only complain about idle-states if it is malformed

Pratyush Yadav p.yadav at ti.com
Fri Feb 5 12:06:27 CET 2021


On 04/02/21 11:39PM, Sean Anderson wrote:
> idle-states is optional, so don't complain if it doesn't exist.

This commit doesn't just silence the complaint. It also changes the 
behavior of the function if the error code is ENODATA or EOVERFLOW. Make 
sure the commit message reflects that.

> 
> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
> ---
> 
>  drivers/mux/mmio.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mux/mmio.c b/drivers/mux/mmio.c
> index 00e0282dcc..82b1cc6aab 100644
> --- a/drivers/mux/mmio.c
> +++ b/drivers/mux/mmio.c
> @@ -87,8 +87,11 @@ static int mmio_mux_probe(struct udevice *dev)
>  
>  	ret = dev_read_u32_array(dev, "idle-states", idle_states, num_fields);
>  	if (ret < 0) {
> -		log_err("idle-states");
>  		devm_kfree(dev, idle_states);
> +		/* dev_read_u32_array returns -EINVAL on missing property */
> +		if (ret != -EINVAL)
> +			return log_msg_ret("idle-states", -EINVAL);

Return ret here. I don't see any reason to return -EINVAL when the error 
is _not_ -EINVAL.

> +
>  		idle_states = NULL;
>  	}
>  
> -- 
> 2.29.2
> 

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.


More information about the U-Boot mailing list