diff options
-rw-r--r-- | sound/soc/soc-cache.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index db66dc44add2..5d76da43b14c 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c | |||
@@ -1609,24 +1609,23 @@ int snd_soc_cache_sync(struct snd_soc_codec *codec) | |||
1609 | return 0; | 1609 | return 0; |
1610 | } | 1610 | } |
1611 | 1611 | ||
1612 | if (!codec->cache_ops || !codec->cache_ops->sync) | ||
1613 | return -EINVAL; | ||
1614 | |||
1612 | if (codec->cache_ops->name) | 1615 | if (codec->cache_ops->name) |
1613 | name = codec->cache_ops->name; | 1616 | name = codec->cache_ops->name; |
1614 | else | 1617 | else |
1615 | name = "unknown"; | 1618 | name = "unknown"; |
1616 | 1619 | ||
1617 | if (codec->cache_ops && codec->cache_ops->sync) { | 1620 | if (codec->cache_ops->name) |
1618 | if (codec->cache_ops->name) | 1621 | dev_dbg(codec->dev, "Syncing %s cache for %s codec\n", |
1619 | dev_dbg(codec->dev, "Syncing %s cache for %s codec\n", | 1622 | codec->cache_ops->name, codec->name); |
1620 | codec->cache_ops->name, codec->name); | 1623 | trace_snd_soc_cache_sync(codec, name, "start"); |
1621 | trace_snd_soc_cache_sync(codec, name, "start"); | 1624 | ret = codec->cache_ops->sync(codec); |
1622 | ret = codec->cache_ops->sync(codec); | 1625 | if (!ret) |
1623 | if (!ret) | 1626 | codec->cache_sync = 0; |
1624 | codec->cache_sync = 0; | 1627 | trace_snd_soc_cache_sync(codec, name, "end"); |
1625 | trace_snd_soc_cache_sync(codec, name, "end"); | 1628 | return ret; |
1626 | return ret; | ||
1627 | } | ||
1628 | |||
1629 | return -EINVAL; | ||
1630 | } | 1629 | } |
1631 | EXPORT_SYMBOL_GPL(snd_soc_cache_sync); | 1630 | EXPORT_SYMBOL_GPL(snd_soc_cache_sync); |
1632 | 1631 | ||