[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210311180225.GA11650@duo.ucw.cz>
Date: Thu, 11 Mar 2021 19:02:25 +0100
From: Pavel Machek <pavel@....cz>
To: Hermes Zhang <chenhui.zhang@...s.com>
Cc: Dan Murphy <dmurphy@...com>, kernel@...s.com,
Hermes Zhang <chenhuiz@...s.com>, linux-kernel@...r.kernel.org,
linux-leds@...r.kernel.org
Subject: Re: [PATCH] leds: leds-dual-gpio: Add dual GPIO LEDs driver
Hi!
> + priv = devm_kzalloc(dev, sizeof(struct gpio_dual_leds_priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + priv->low_gpio = devm_gpiod_get(dev, "low", GPIOD_OUT_LOW);
> + ret = PTR_ERR_OR_ZERO(priv->low_gpio);
> + if (ret) {
> + dev_err(dev, "cannot get low-gpios %d\n", ret);
> + return ret;
> + }
> +
> + priv->high_gpio = devm_gpiod_get(dev, "high", GPIOD_OUT_LOW);
> + ret = PTR_ERR_OR_ZERO(priv->high_gpio);
> + if (ret) {
> + dev_err(dev, "cannot get high-gpios %d\n", ret);
> + return ret;
> + }
Actually... I'd call it led-0 and led-1 or something. Someone may/will
come with 4-bit GPIO LED one day, and it would be cool if this could
be used with minimal effort.
Calling it multi_led in the driver/bindings would bnot be bad, either.
Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists