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.
signature.asc
Description: Digital signature
_______________________________________________ devicetree-discuss mailing list devicetree-discuss@lists.ozlabs.org https://lists.ozlabs.org/listinfo/devicetree-discuss