Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: compress: Drop unused functions

snd_compress_register() and snd_compress_deregister() API functions
have been never used by in-tree drivers.
Let's clean up the dead code.

Acked-by: Vinod Koul <vkoul@kernel.org>
Reviewed-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210714162424.4412-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

-70
-2
include/sound/compress_driver.h
··· 165 165 }; 166 166 167 167 /* compress device register APIs */ 168 - int snd_compress_register(struct snd_compr *device); 169 - int snd_compress_deregister(struct snd_compr *device); 170 168 int snd_compress_new(struct snd_card *card, int device, 171 169 int type, const char *id, struct snd_compr *compr); 172 170
-68
sound/core/compress_offload.c
··· 47 47 * driver should be able to register multiple nodes 48 48 */ 49 49 50 - static DEFINE_MUTEX(device_mutex); 51 - 52 50 struct snd_compr_file { 53 51 unsigned long caps; 54 52 struct snd_compr_stream stream; ··· 1190 1192 return ret; 1191 1193 } 1192 1194 EXPORT_SYMBOL_GPL(snd_compress_new); 1193 - 1194 - static int snd_compress_add_device(struct snd_compr *device) 1195 - { 1196 - int ret; 1197 - 1198 - if (!device->card) 1199 - return -EINVAL; 1200 - 1201 - /* register the card */ 1202 - ret = snd_card_register(device->card); 1203 - if (ret) 1204 - goto out; 1205 - return 0; 1206 - 1207 - out: 1208 - pr_err("failed with %d\n", ret); 1209 - return ret; 1210 - 1211 - } 1212 - 1213 - static int snd_compress_remove_device(struct snd_compr *device) 1214 - { 1215 - return snd_card_free(device->card); 1216 - } 1217 - 1218 - /** 1219 - * snd_compress_register - register compressed device 1220 - * 1221 - * @device: compressed device to register 1222 - */ 1223 - int snd_compress_register(struct snd_compr *device) 1224 - { 1225 - int retval; 1226 - 1227 - if (device->name == NULL || device->ops == NULL) 1228 - return -EINVAL; 1229 - 1230 - pr_debug("Registering compressed device %s\n", device->name); 1231 - if (snd_BUG_ON(!device->ops->open)) 1232 - return -EINVAL; 1233 - if (snd_BUG_ON(!device->ops->free)) 1234 - return -EINVAL; 1235 - if (snd_BUG_ON(!device->ops->set_params)) 1236 - return -EINVAL; 1237 - if (snd_BUG_ON(!device->ops->trigger)) 1238 - return -EINVAL; 1239 - 1240 - mutex_init(&device->lock); 1241 - 1242 - /* register a compressed card */ 1243 - mutex_lock(&device_mutex); 1244 - retval = snd_compress_add_device(device); 1245 - mutex_unlock(&device_mutex); 1246 - return retval; 1247 - } 1248 - EXPORT_SYMBOL_GPL(snd_compress_register); 1249 - 1250 - int snd_compress_deregister(struct snd_compr *device) 1251 - { 1252 - pr_debug("Removing compressed device %s\n", device->name); 1253 - mutex_lock(&device_mutex); 1254 - snd_compress_remove_device(device); 1255 - mutex_unlock(&device_mutex); 1256 - return 0; 1257 - } 1258 - EXPORT_SYMBOL_GPL(snd_compress_deregister); 1259 1195 1260 1196 MODULE_DESCRIPTION("ALSA Compressed offload framework"); 1261 1197 MODULE_AUTHOR("Vinod Koul <vinod.koul@linux.intel.com>");