[alsa-devel] [PATCH] ASoC: rt5640: add device tree support

Mark Brown broonie at kernel.org
Wed Jun 12 18:46:28 CEST 2013


On Tue, Jun 11, 2013 at 02:40:40PM -0600, Stephen Warren wrote:

> +- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.

Why gpios and not gpio?

> -	if (rt5640->pdata.ldo1_en) {
> +	if (gpio_is_valid(rt5640->pdata.ldo1_en)) {
>  		ret = devm_gpio_request_one(&i2c->dev, rt5640->pdata.ldo1_en,
>  					    GPIOF_OUT_INIT_HIGH,

Unfortunately gpio_is_valid() is unhelpful for platform data since often
zero is a valid GPIO but it's also the default "do nothing" platform
data.  It's therefore better to either include a check for non-zero as
well or have code that takes a zero in the platform data and sets it to
a negative value instead.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130612/bf7f788b/attachment.sig>


More information about the Alsa-devel mailing list