Re: [PATCH] leds: leds-dual-gpio: Add dual GPIO LEDs driver

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

 



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

Attachment: signature.asc
Description: PGP signature


[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