[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGngYiVmOm2985Xu5pXdAx7Gx=hXJ-uUjMSgTv4L9_WeiyCXug@mail.gmail.com>
Date: Mon, 9 Dec 2019 10:15:02 -0500
From: Sven Van Asbroeck <thesven73@...il.com>
To: Dan Murphy <dmurphy@...com>
Cc: Lee Jones <lee.jones@...aro.org>, Pavel Machek <pavel@....cz>,
Linus Walleij <linus.walleij@...aro.org>,
Grigoryev Denis <grigoryev@...twel.ru>,
Axel Lin <axel.lin@...ics.com>,
Jacek Anaszewski <jacek.anaszewski@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
devicetree <devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-leds@...r.kernel.org
Subject: Re: [PATCH v5 1/2] leds: tps6105x: add driver for mfd chip led mode
Thank you for the review, Dan. Some remarks below.
On Mon, Dec 9, 2019 at 9:12 AM Dan Murphy <dmurphy@...com> 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.
Powered by blists - more mailing lists