Merge branch 'for-linus' of git://neil.brown.name/md
[pandora-kernel.git] / sound / soc / soc-cache.c
index 06b7b81..039b953 100644 (file)
@@ -409,9 +409,6 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
        codec->bulk_write_raw = snd_soc_hw_bulk_write_raw;
 
        switch (control) {
-       case SND_SOC_CUSTOM:
-               break;
-
        case SND_SOC_I2C:
 #if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
                codec->hw_write = (hw_write_t)i2c_master_send;
@@ -466,6 +463,9 @@ static bool snd_soc_set_cache_val(void *base, unsigned int idx,
 static unsigned int snd_soc_get_cache_val(const void *base, unsigned int idx,
                unsigned int word_size)
 {
+       if (!base)
+               return -1;
+
        switch (word_size) {
        case 1: {
                const u8 *cache = base;