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

Mark Brown broonie at kernel.org
Wed Jun 12 19:06:06 CEST 2013


On Wed, Jun 12, 2013 at 10:56:46AM -0600, Stephen Warren wrote:
> On 06/12/2013 10:46 AM, Mark Brown wrote:

> > 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.

> I think people filling in platform data should simply be required to
> put a valid/correct value in that field. There aren't any users of
> this, so it's not like adding a new field where
> backwards-compatibility might be a concern (and even then, updating
> all users of this platform data type wouldn't be hard), and it should
> be obvious if you get it wrong.

It's not idiomatic to do it this way, it'll catch people out - sadly the
effects are often non-obvious, depending on what actually happens with
the GPIO.  Were it not for renumbering pain it'd probably be most
sensible to just make 0 never a valid GPIO :/
-------------- 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/1caffcaf/attachment.sig>


More information about the Alsa-devel mailing list