lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YfOLRBGmwGKwCksR@google.com>
Date:   Thu, 27 Jan 2022 22:20:52 -0800
From:   Benson Leung <bleung@...gle.com>
To:     Prashant Malani <pmalani@...omium.org>
Cc:     linux-kernel@...r.kernel.org,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Benson Leung <bleung@...omium.org>,
        "open list:CHROMEOS EC USB TYPE-C DRIVER" 
        <chrome-platform@...ts.linux.dev>,
        Guenter Roeck <groeck@...omium.org>
Subject: Re: [PATCH] platform/chrome: cros_ec_typec: Make try power role
 optional

Hi Prashant,

On Thu, Jan 27, 2022 at 07:16:59PM +0000, Prashant Malani wrote:
> Some boards prefer not to specify a try-power-role. Update the port
> property parsing logic to not error out in case a try-power-role is not
> specified.
> 
> Cc: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> Signed-off-by: Prashant Malani <pmalani@...omium.org>

This looks good to me.

Heikki, if this usage of TYPEC_NO_PREFERRED_ROLE looks good to you, I can
merge it.

Benson

> ---
>  drivers/platform/chrome/cros_ec_typec.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c
> index 5de0bfb0bc4d..ee12658009e5 100644
> --- a/drivers/platform/chrome/cros_ec_typec.c
> +++ b/drivers/platform/chrome/cros_ec_typec.c
> @@ -115,17 +115,18 @@ static int cros_typec_parse_port_props(struct typec_capability *cap,
>  		return ret;
>  	cap->data = ret;
>  
> +	/* Try-power-role is optional. */
>  	ret = fwnode_property_read_string(fwnode, "try-power-role", &buf);
>  	if (ret) {
> -		dev_err(dev, "try-power-role not found: %d\n", ret);
> -		return ret;
> +		dev_warn(dev, "try-power-role not found: %d\n", ret);
> +		cap->prefer_role = TYPEC_NO_PREFERRED_ROLE;
> +	} else {
> +		ret = typec_find_power_role(buf);
> +		if (ret < 0)
> +			return ret;
> +		cap->prefer_role = ret;
>  	}
>  
> -	ret = typec_find_power_role(buf);
> -	if (ret < 0)
> -		return ret;
> -	cap->prefer_role = ret;
> -
>  	cap->fwnode = fwnode;
>  
>  	return 0;
> -- 
> 2.35.0.rc0.227.g00780c9af4-goog
> 

-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@...gle.com
Chromium OS Project
bleung@...omium.org

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ