Re: [PATCH V3 1/2] gpio: inverter: Add Inverter controller for gpio configuration

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

 



Hi Harish,

second pass, I think the DT review is the most important thing now.

On Wed, Jun 19, 2019 at 1:45 PM Harish Jenny K N
<harish_kandiga@xxxxxxxxxx> wrote:

> +#include <linux/of_gpio.h>

Please don't use these old interfaces.
Use this:

#include <linux/gpio/consumer.h>

I'll show more details of that.

> +       count = of_gpio_named_count(dev->of_node, "inverted-gpios");

count = gpiod_count(dev, "inverted");

> +       while (index < count) {
> +               gpio = devm_gpiod_get_index(dev, "inverted", index, GPIOD_ASIS);
> +
> +               if (gpio == ERR_PTR(-ENOENT)) {
> +                       devm_kfree(dev, inv);

I think devm_ i guaranteed to free any allocated memory if probe()
fails.

Yours,
Linus Walleij



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux