On Wed, 17 Jun 2026, Andy Shevchenko wrote: > On Wed, Jun 17, 2026 at 11:00:19AM +0300, Svyatoslav Ryhel wrote: > > Remove driver-specific regmap wrappers in favor of using regmap helpers > > directly. > > OK, let's go with this variant. > Reviewed-by: Andy Shevchenko <[email protected]> > > Some side notes below for the record. > > ... > > > struct lm3533_led *led = to_lm3533_led(led_cdev); > > unsigned enable; > > Oh, besides using the old way of declaring unsigned int, it most likely > just needs to be kstrtobool(). > > > u8 reg; > > - u8 mask; > > - u8 val; > > int ret; > > > > if (kstrtouint(buf, 0, &enable)) > > return -EINVAL; > > We should unshadow error codes (it may return more than -EINVAL).
Right, this masks -ERANGE. We should fix that. > > reg = lm3533_led_get_lv_reg(led, LM3533_REG_CTRLBANK_BCONF_BASE); > > - mask = LM3533_REG_CTRLBANK_BCONF_ALS_EN_MASK; > > > > - if (enable) > > - val = mask; > > - else > > - val = 0; > > - > > ... > > > - if (kstrtou8(buf, 0, &val)) > > + if (kstrtou32(buf, 0, &val)) > > return -EINVAL; > > Like in the previous case we should unshadow error codes. > > -- > With Best Regards, > Andy Shevchenko > > -- Lee Jones
