Skip to contentSkip to conversation

ASoC: soc-cache: Return -ENOSYS instead of -EINVAL

PATCH Applied Dimitris Papastamos 2 participants 2 messages Mar 22, 2011 – Mar 26, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: soc-cache: Return -ENOSYS instead of -EINVAL

These functions fail with -EINVAL if the corresponding callbacks are not implemented. Change them to return -ENOSYS as it is more appropriate for unimplemented callbacks.

---
 sound/soc/soc-cache.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
sound/soc/soc-cache.c +5 -5
index 86beaad..0e2871e 100644
@@ -1295,7 +1295,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
 				codec->cache_ops->name, codec->name);
 		return codec->cache_ops->init(codec);
 	}
-	return -EINVAL;
+	return -ENOSYS;
 }
 
 /*
@@ -1310,7 +1310,7 @@ int snd_soc_cache_exit(struct snd_soc_codec *codec)
 				codec->cache_ops->name, codec->name);
 		return codec->cache_ops->exit(codec);
 	}
-	return -EINVAL;
+	return -ENOSYS;
 }
 
 /**
@@ -1334,7 +1334,7 @@ int snd_soc_cache_read(struct snd_soc_codec *codec,
 	}
 
 	mutex_unlock(&codec->cache_rw_mutex);
-	return -EINVAL;
+	return -ENOSYS;
 }
 EXPORT_SYMBOL_GPL(snd_soc_cache_read);
 
@@ -1359,7 +1359,7 @@ int snd_soc_cache_write(struct snd_soc_codec *codec,
 	}
 
 	mutex_unlock(&codec->cache_rw_mutex);
-	return -EINVAL;
+	return -ENOSYS;
 }
 EXPORT_SYMBOL_GPL(snd_soc_cache_write);
 
@@ -1382,7 +1382,7 @@ int snd_soc_cache_sync(struct snd_soc_codec *codec)
 	}
 
 	if (!codec->cache_ops || !codec->cache_ops->sync)
-		return -EINVAL;
+		return -ENOSYS;
 
 	if (codec->cache_ops->name)
 		name = codec->cache_ops->name;
Signature · 1 line
1.7.4.1
Applied
#1 lore raw
Quoted 5 lines · Dimitris Papastamos

These functions fail with -EINVAL if the corresponding callbacks are not implemented. Change them to return -ENOSYS as it is more appropriate for unimplemented callbacks.

Applied, thanks.