On Mon, Jun 01, 2026 at 06:18:28PM +0300, Svyatoslav Ryhel wrote:
> Simplify the sysfs logic of the linear property by switching to a macro
> and a ternary operator.

...

>       if (kstrtoul(buf, 0, &linear))
>               return -EINVAL;

Besides _assign_bits() in the below, side note here to unshadow error codes:

        ret = kstrtoul(buf, 0, &linear);
        if (ret)
                return ret;

(obviously in a separate change).

...

>       ret = regmap_update_bits(bl->lm3533->regmap, 
> LM3533_REG_CTRLBANK_AB_BCONF,
> -                              mask, val);
> +                              CTRLBANK_AB_BCONF_MODE(id),
> +                              linear ? CTRLBANK_AB_BCONF_MODE(id) : 0);
>       if (ret)
>               return ret;

-- 
With Best Regards,
Andy Shevchenko


Reply via email to