lkml.org 
[lkml]   [2024]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 05/18] mux: add mux_chip_resume() function
On Thu, Feb 15, 2024 at 04:17:50PM +0100, Thomas Richard wrote:
> The mux_chip_resume() function restores a mux_chip using the cached state
> of each mux.

..

> +int mux_chip_resume(struct mux_chip *mux_chip)
> +{
> + int global_ret = 0;
> + int ret, i;
> +
> + for (i = 0; i < mux_chip->controllers; ++i) {
> + struct mux_control *mux = &mux_chip->mux[i];
> +
> + if (mux->cached_state == MUX_CACHE_UNKNOWN)
> + continue;
> +
> + ret = mux_control_set(mux, mux->cached_state);
> + if (ret < 0) {
> + dev_err(&mux_chip->dev, "unable to restore state\n");
> + if (!global_ret)
> + global_ret = ret;

Hmm... This will record the first error and continue.

> + }
> + }
> + return global_ret;

So here, we actually will get stale data in case there are > 1 failures.

> +}

--
With Best Regards,
Andy Shevchenko



\
 
 \ /
  Last update: 2024-05-27 15:05    [W:1.409 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site