Re: [PATCH v2] power: supply: cros_charge-control: adopt EC charge state on probe

Tzung-Bi Shih <[email protected]>
Newsgroups org.kernel.vger.linux-pm,dev.linux.lists.chrome-platform,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue, Aug 25, 2026 at 07:09:00AM -0500, Matt DeVillier wrote:
> diff --git a/drivers/power/supply/cros_charge-control.c b/drivers/power/supply/cros_charge-control.c
...
> +static int cros_chctl_init_state(struct cros_chctl_priv *priv)
> +{
> +	struct ec_response_charge_control resp;
> +	s8 lower, upper;
> +	int ret;
> +
> +	guard(mutex)(&priv->lock);
> +
> +	/* v1 cannot report current state; force a well-known EC configuration. */
> +	if (priv->cmd_version < 2) {
> +		cros_chctl_set_default_state(priv);
> +		return cros_chctl_configure_ec(priv);

Given it has introduced the label, how about:

    goto defaults;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.