Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* SoC codec read callback definition
@ 2009-07-23  7:50 Lopez Cruz, Misael
  2009-07-23 15:46 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Lopez Cruz, Misael @ 2009-07-23  7:50 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

read callback (of snd_soc_codec struct) is defined as a function
that returns unsigned int:

struct snd_soc_codec {
	...
	unsigned int (*read)(struct snd_soc_codec *, unsigned int);
	int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
      ...
}  

However, actual implementation of that callback in many CODEC drivers
may return a negative error value (i.e. when a register is out of cache
reg size). Should the callback definition be changed to return _int_
instead of _unsigned int_? Some drivers (like wm8900, wm9081) handle
invalid registers with BUG_ON, in that case it's not necessary to
return the negative error code.

What should be the best way to handle this? Or is it ok as currently
implemented? Well, it was just a thought.

-Misa

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-23 15:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-23  7:50 SoC codec read callback definition Lopez Cruz, Misael
2009-07-23 15:46 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox