From 417ced8b93d16f6f90336fdf6929ed599e74f705 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Wed, 26 Jun 2013 11:53:45 +0100 Subject: ASoC: ep93xx: Remove redundant dev_set_drvdata() calls The driver core does this and it's never legal to rely on the value of drvdata if not set in probe() anyway. Signed-off-by: Mark Brown --- sound/soc/cirrus/ep93xx-ac97.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'sound/soc/cirrus') diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index 7798fbd5e81d..d49e0556e381 100644 --- a/sound/soc/cirrus/ep93xx-ac97.c +++ b/sound/soc/cirrus/ep93xx-ac97.c @@ -405,7 +405,6 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) fail: platform_set_drvdata(pdev, NULL); ep93xx_ac97_info = NULL; - dev_set_drvdata(&pdev->dev, NULL); return ret; } @@ -420,7 +419,6 @@ static int ep93xx_ac97_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); ep93xx_ac97_info = NULL; - dev_set_drvdata(&pdev->dev, NULL); return 0; } -- cgit From b047e1cce8fe32475ab61846772943a5e4c0a908 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Wed, 26 Jun 2013 12:45:59 +0100 Subject: ASoC: ac97: Support multi-platform AC'97 Currently we can only have a single platform built in with AC'97 support due to the use of a global variable to provide the bus operations. Fix this by making that variable a pointer and having the bus drivers set the operations prior to registering. This is not a particularly good or nice approach but it avoids blocking multiplatform and a real fix involves fixing the fairly deep problems with AC'97 support - we should be converting it to a real bus. Acked-by: Arnd Bergmann Reviewed-by: Stephen Warren Signed-off-by: Mark Brown --- sound/soc/cirrus/ep93xx-ac97.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sound/soc/cirrus') diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index d49e0556e381..4bc9490e2c84 100644 --- a/sound/soc/cirrus/ep93xx-ac97.c +++ b/sound/soc/cirrus/ep93xx-ac97.c @@ -237,13 +237,12 @@ static irqreturn_t ep93xx_ac97_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -struct snd_ac97_bus_ops soc_ac97_ops = { +static struct snd_ac97_bus_ops ep93xx_ac97_ops = { .read = ep93xx_ac97_read, .write = ep93xx_ac97_write, .reset = ep93xx_ac97_cold_reset, .warm_reset = ep93xx_ac97_warm_reset, }; -EXPORT_SYMBOL_GPL(soc_ac97_ops); static int ep93xx_ac97_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) @@ -395,6 +394,10 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) ep93xx_ac97_info = info; platform_set_drvdata(pdev, info); + ret = snd_soc_set_ac97_ops(&ep93xx_ac97_ops); + if (ret) + goto fail; + ret = snd_soc_register_component(&pdev->dev, &ep93xx_ac97_component, &ep93xx_ac97_dai, 1); if (ret) @@ -405,6 +408,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) fail: platform_set_drvdata(pdev, NULL); ep93xx_ac97_info = NULL; + snd_soc_set_ac97_ops(NULL); return ret; } @@ -420,6 +424,8 @@ static int ep93xx_ac97_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); ep93xx_ac97_info = NULL; + snd_soc_set_ac97_ops(NULL); + return 0; } -- cgit