Thread (32 messages) 32 messages, 6 authors, 2d ago

Re: [PATCH v5 02/14] mfd: lm3533: Remove driver specific regmap wrappers

From: Lee Jones <lee@kernel.org>
Date: 2026-07-02 16:13:01
Also in: dri-devel, linux-devicetree, linux-iio, linux-leds, lkml

On Wed, 17 Jun 2026, Andy Shevchenko wrote:
On Wed, Jun 17, 2026 at 11:00:19AM +0300, Svyatoslav Ryhel wrote:
quoted
Remove driver-specific regmap wrappers in favor of using regmap helpers
directly.
OK, let's go with this variant.
Reviewed-by: Andy Shevchenko <redacted>

Some side notes below for the record.

...
quoted
 	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().
quoted
 	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.
quoted
 	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;
-
...
quoted
-	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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help