diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2020-05-28 03:47:46 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-05-30 03:11:27 +0200 |
commit | 1793936bc9081d541da2ecd2af83eded7e6212a7 (patch) | |
tree | 797c5eec91deaf75ab56285c8eb7b27b08be697e /sound/soc/soc-card.c | |
parent | ASoC: soc.h: convert bool to bit field for snd_soc_card (diff) | |
download | linux-1793936bc9081d541da2ecd2af83eded7e6212a7.tar.xz linux-1793936bc9081d541da2ecd2af83eded7e6212a7.zip |
ASoC: add soc-card.c
Current ALSA SoC has some snd_soc_card_xxx() functions,
and card->xxx() callbacks.
But, it is implemented randomly at random place.
To collect all card related functions into one place,
this patch creats new soc-card.c.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87blm825kt.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | sound/soc/soc-card.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sound/soc/soc-card.c b/sound/soc/soc-card.c new file mode 100644 index 000000000000..4bc6f26ea8cb --- /dev/null +++ b/sound/soc/soc-card.c @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0 +// +// soc-card.c +// +// Copyright (C) 2019 Renesas Electronics Corp. +// Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> +// +#include <sound/soc.h> + +#define soc_card_ret(dai, ret) _soc_card_ret(dai, __func__, ret) +static inline int _soc_card_ret(struct snd_soc_card *card, + const char *func, int ret) +{ + switch (ret) { + case -EPROBE_DEFER: + case -ENOTSUPP: + case 0: + break; + default: + dev_err(card->dev, + "ASoC: error at %s on %s: %d\n", + func, card->name, ret); + } + + return ret; +} |