On Thu, 2017-04-13 at 18:43 +0200, Peter Rosin wrote:
[...]
> +int mux_chip_register(struct mux_chip *mux_chip)
> +{
> +     int i;
> +     int ret;
> +
> +     for (i = 0; i < mux_chip->controllers; ++i) {
> +             struct mux_control *mux = &mux_chip->mux[i];
> +
> +             if (mux->idle_state == mux->cached_state)
> +                     continue;

I think this should be changed to
 
-               if (mux->idle_state == mux->cached_state)
+               if (mux->idle_state == mux->cached_state ||
+                   mux->idle_state == MUX_IDLE_AS_IS)
                        continue;

or the following mux_control_set will be called with state ==
MUX_IDLE_AS_IS. Alternatively, mux_control_set should return when passed
this value.

> +             ret = mux_control_set(mux, mux->idle_state);
> +             if (ret < 0) {
> +                     dev_err(&mux_chip->dev, "unable to set idle state\n");
> +                     return ret;
> +             }
> +     }
> +
> +     ret = device_add(&mux_chip->dev);
> +     if (ret < 0)
> +             dev_err(&mux_chip->dev,
> +                     "device_add failed in mux_chip_register: %d\n", ret);
> +     return ret;
> +}
> +EXPORT_SYMBOL_GPL(mux_chip_register);

regards
Philipp

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to