diff options
-rw-r--r-- | include/sound/soc.h | 2 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 21 |
2 files changed, 13 insertions, 10 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 541ddfaa1243..9952254974b3 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -258,6 +258,8 @@ enum snd_soc_compress_type { | |||
258 | SND_SOC_RBTREE_COMPRESSION | 258 | SND_SOC_RBTREE_COMPRESSION |
259 | }; | 259 | }; |
260 | 260 | ||
261 | int snd_soc_register_card(struct snd_soc_card *card); | ||
262 | int snd_soc_unregister_card(struct snd_soc_card *card); | ||
261 | int snd_soc_register_platform(struct device *dev, | 263 | int snd_soc_register_platform(struct device *dev, |
262 | struct snd_soc_platform_driver *platform_drv); | 264 | struct snd_soc_platform_driver *platform_drv); |
263 | void snd_soc_unregister_platform(struct device *dev); | 265 | void snd_soc_unregister_platform(struct device *dev); |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 83057127b2fa..69117b686fdc 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -58,8 +58,6 @@ static LIST_HEAD(dai_list); | |||
58 | static LIST_HEAD(platform_list); | 58 | static LIST_HEAD(platform_list); |
59 | static LIST_HEAD(codec_list); | 59 | static LIST_HEAD(codec_list); |
60 | 60 | ||
61 | static int snd_soc_register_card(struct snd_soc_card *card); | ||
62 | static int snd_soc_unregister_card(struct snd_soc_card *card); | ||
63 | static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num); | 61 | static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num); |
64 | 62 | ||
65 | /* | 63 | /* |
@@ -1870,6 +1868,13 @@ static int soc_probe(struct platform_device *pdev) | |||
1870 | struct snd_soc_card *card = platform_get_drvdata(pdev); | 1868 | struct snd_soc_card *card = platform_get_drvdata(pdev); |
1871 | int ret = 0; | 1869 | int ret = 0; |
1872 | 1870 | ||
1871 | /* | ||
1872 | * no card, so machine driver should be registering card | ||
1873 | * we should not be here in that case so ret error | ||
1874 | */ | ||
1875 | if (!card) | ||
1876 | return -EINVAL; | ||
1877 | |||
1873 | /* Bodge while we unpick instantiation */ | 1878 | /* Bodge while we unpick instantiation */ |
1874 | card->dev = &pdev->dev; | 1879 | card->dev = &pdev->dev; |
1875 | snd_soc_initialize_card_lists(card); | 1880 | snd_soc_initialize_card_lists(card); |
@@ -3105,11 +3110,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_digital_mute); | |||
3105 | * | 3110 | * |
3106 | * @card: Card to register | 3111 | * @card: Card to register |
3107 | * | 3112 | * |
3108 | * Note that currently this is an internal only function: it will be | ||
3109 | * exposed to machine drivers after further backporting of ASoC v2 | ||
3110 | * registration APIs. | ||
3111 | */ | 3113 | */ |
3112 | static int snd_soc_register_card(struct snd_soc_card *card) | 3114 | int snd_soc_register_card(struct snd_soc_card *card) |
3113 | { | 3115 | { |
3114 | int i; | 3116 | int i; |
3115 | 3117 | ||
@@ -3141,17 +3143,15 @@ static int snd_soc_register_card(struct snd_soc_card *card) | |||
3141 | 3143 | ||
3142 | return 0; | 3144 | return 0; |
3143 | } | 3145 | } |
3146 | EXPORT_SYMBOL_GPL(snd_soc_register_card); | ||
3144 | 3147 | ||
3145 | /** | 3148 | /** |
3146 | * snd_soc_unregister_card - Unregister a card with the ASoC core | 3149 | * snd_soc_unregister_card - Unregister a card with the ASoC core |
3147 | * | 3150 | * |
3148 | * @card: Card to unregister | 3151 | * @card: Card to unregister |
3149 | * | 3152 | * |
3150 | * Note that currently this is an internal only function: it will be | ||
3151 | * exposed to machine drivers after further backporting of ASoC v2 | ||
3152 | * registration APIs. | ||
3153 | */ | 3153 | */ |
3154 | static int snd_soc_unregister_card(struct snd_soc_card *card) | 3154 | int snd_soc_unregister_card(struct snd_soc_card *card) |
3155 | { | 3155 | { |
3156 | if (card->instantiated) | 3156 | if (card->instantiated) |
3157 | soc_cleanup_card_resources(card); | 3157 | soc_cleanup_card_resources(card); |
@@ -3162,6 +3162,7 @@ static int snd_soc_unregister_card(struct snd_soc_card *card) | |||
3162 | 3162 | ||
3163 | return 0; | 3163 | return 0; |
3164 | } | 3164 | } |
3165 | EXPORT_SYMBOL_GPL(snd_soc_unregister_card); | ||
3165 | 3166 | ||
3166 | /* | 3167 | /* |
3167 | * Simplify DAI link configuration by removing ".-1" from device names | 3168 | * Simplify DAI link configuration by removing ".-1" from device names |