Re: [PATCH v10 2/2] leds: as3668: Driver for the ams Osram 4-channel i2c LED driver

From: Lee Jones
Date: Tue Nov 25 2025 - 08:00:49 EST


On Fri, 21 Nov 2025, Lukas Timmermann wrote:

> On Thu, Nov 20, 2025 at 12:07:04PM +0000, Lee Jones wrote:
> > On Mon, 17 Nov 2025, Lukas Timmermann wrote:
> >
> > > Since there were no existing drivers for the AS3668 or related devices,
> > > a new driver was introduced in a separate file. Similar devices were
> > > reviewed, but none shared enough characteristics to justify code reuse.
> > > As a result, this driver is written specifically for the AS3668.
> > >
> > > Signed-off-by: Lukas Timmermann <linux@timmermann.space>
> > > ---
> > > MAINTAINERS | 1 +
> > > drivers/leds/Kconfig | 13 +++
> > > drivers/leds/Makefile | 1 +
> > > drivers/leds/leds-as3668.c | 222 +++++++++++++++++++++++++++++++++++++
> > > 4 files changed, 237 insertions(+)
> > > create mode 100644 drivers/leds/leds-as3668.c

[...]

> > > + if (reg < 0) {
> > > + dev_err(&as3668->client->dev, "failed to read channel modes\n");
> > > + return;
> > > + }
> > > +
> > > + switch (led_id) {
> > > + case 0:
> > > + reg &= ~AS3668_CURR1_MODE_MASK;
> > > + reg |= FIELD_PREP(AS3668_CURR1_MODE_MASK, mode);
> > > + break;
> > > + case 1:
> > > + reg &= ~AS3668_CURR2_MODE_MASK;
> > > + reg |= FIELD_PREP(AS3668_CURR2_MODE_MASK, mode);
> > > + break;
> > > + case 2:
> > > + reg &= ~AS3668_CURR3_MODE_MASK;
> > > + reg |= FIELD_PREP(AS3668_CURR3_MODE_MASK, mode);
> > > + break;
> > > + case 3:
> > > + reg &= ~AS3668_CURR4_MODE_MASK;
> > > + reg |= FIELD_PREP(AS3668_CURR4_MODE_MASK, mode);
> > > + break;
> > > + default:
> > > + return;
> > > + }
> > > +
> > > + err = i2c_smbus_write_byte_data(as3668->client, AS3668_CURR_MODE_REG, reg);
> >
> > Either it's an error or it's not. Why isn't it being propagated?
> >
> My patch had a dev_err() call here. It's missing in your citation.
> Was using dev_err() here wrong?

Yes. It's preferable that you propagate (return) the error.

If you don't do that, it's just a warning.

--
Lee Jones [李琼斯]