On Wed, Jan 05, 2011 at 03:04:31PM -0600, Timur Tabi wrote:
Unlike all the other codec drivers, the CS4270 driver does not initialize codec_drv->reg_cache_default, so the pointer is NULL during the kmemdup() call.
What is the criteria for defining reg_cache_default? Many drivers don't define it:
In general the expectation is that unless it's got a good reason not to a well written CODEC driver will use all the standard register cache infrastructure, including providing a set of defaults. Good reasons for this include things like not having any registers and indeterminate default hardware state.
As you will doubtless have seen when you looked at the code every other reference to reg_cache_default checks to see if it's set before using it. This does rather suggest that the intention of the code is that it be optional.