mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
ASoC: fsl: p1022_ds: add card_to_mdata() macro
p1022_ds.c will be updated when Card capsuling. To makes its review easy, adds card_to_mdata() and useit to reduce un-related diff. No functional change, but is preparation for cleanup driver. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/875x29jfj4.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
beb41b8b14
commit
2700946d7b
|
|
@ -73,6 +73,8 @@ struct machine_data {
|
|||
char platform_name[2][DAI_NAME_SIZE]; /* One for each DMA channel */
|
||||
};
|
||||
|
||||
#define card_to_mdata(_card) container_of(_card, struct machine_data, card)
|
||||
|
||||
/**
|
||||
* p1022_ds_machine_probe: initialize the board
|
||||
*
|
||||
|
|
@ -82,8 +84,7 @@ struct machine_data {
|
|||
*/
|
||||
static int p1022_ds_machine_probe(struct snd_soc_card *card)
|
||||
{
|
||||
struct machine_data *mdata =
|
||||
container_of(card, struct machine_data, card);
|
||||
struct machine_data *mdata = card_to_mdata(card);
|
||||
struct ccsr_guts __iomem *guts;
|
||||
|
||||
guts = ioremap(guts_phys, sizeof(struct ccsr_guts));
|
||||
|
|
@ -122,8 +123,7 @@ static int p1022_ds_machine_probe(struct snd_soc_card *card)
|
|||
static int p1022_ds_startup(struct snd_pcm_substream *substream)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
|
||||
struct machine_data *mdata =
|
||||
container_of(rtd->card, struct machine_data, card);
|
||||
struct machine_data *mdata = card_to_mdata(rtd->card);
|
||||
struct device *dev = rtd->card->dev;
|
||||
int ret = 0;
|
||||
|
||||
|
|
@ -156,8 +156,7 @@ static int p1022_ds_startup(struct snd_pcm_substream *substream)
|
|||
*/
|
||||
static int p1022_ds_machine_remove(struct snd_soc_card *card)
|
||||
{
|
||||
struct machine_data *mdata =
|
||||
container_of(card, struct machine_data, card);
|
||||
struct machine_data *mdata = card_to_mdata(card);
|
||||
struct ccsr_guts __iomem *guts;
|
||||
|
||||
guts = ioremap(guts_phys, sizeof(struct ccsr_guts));
|
||||
|
|
@ -399,8 +398,7 @@ static int p1022_ds_probe(struct platform_device *pdev)
|
|||
static void p1022_ds_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct snd_soc_card *card = platform_get_drvdata(pdev);
|
||||
struct machine_data *mdata =
|
||||
container_of(card, struct machine_data, card);
|
||||
struct machine_data *mdata = card_to_mdata(card);
|
||||
|
||||
snd_soc_unregister_card(card);
|
||||
kfree(mdata);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user