Re: [PATCH v5 1/2] leds: tps6105x: add driver for mfd chip led mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you for the review, Dan. Some remarks below.

On Mon, Dec 9, 2019 at 9:12 AM Dan Murphy <dmurphy@xxxxxx> wrote:
>
> > +     priv->fwnode = device_get_next_child_node(pdev->dev.parent, NULL);
>
> Probably need to check for NULL on the return
>

The driver will work without crashes or oopses even when this returns NULL:
- struct led_init_data . fwnode is optional (can be NULL)
- fwnode_handle_put() ignores NULL arguments

By not checking for NULL here, non-devicetree users can still select
led mode through platform data on the parent mfd driver, and things
will "just work".

Could I persuade you to keep this behaviour?
Perhaps I should put a comment in to clarify?

> > +     ret = regmap_update_bits(tps6105x->regmap, TPS6105X_REG_0,
> > +             TPS6105X_REG0_MODE_MASK | TPS6105X_REG0_TORCHC_MASK,
> > +             TPS6105X_REG0_MODE_TORCH << TPS6105X_REG0_MODE_SHIFT);
> Checkpatch should have warned about alignment here

I used 5.4's checkpatch.pl, but somehow it doesn't warn :(
Will fix that up.



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux