aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-11-16 04:16:52 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-20 01:11:21 -0500
commit943fdadc17962b7ca6fa28167d1077b383dead4b (patch)
treedb556acf32eee2b9683e3b1da2802566d2a12fad /sound/soc/sh
parent40f9118bd140ce949a38c1a8cbd6105c38e90478 (diff)
ASoC: fsi: tidyup sh_fsi_platform_info pointer
Current FSI driver is requesting sh_fsi_platform_info pointer from platform, and it didn't allowed NULL pointer. This patch fixes it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/fsi.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 913916a3f716..3260d54413c8 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -1991,15 +1991,16 @@ static struct snd_soc_platform_driver fsi_soc_platform = {
1991/* 1991/*
1992 * platform function 1992 * platform function
1993 */ 1993 */
1994static void fsi_handler_init(struct fsi_priv *fsi) 1994static void fsi_handler_init(struct fsi_priv *fsi,
1995 struct sh_fsi_port_info *info)
1995{ 1996{
1996 fsi->playback.handler = &fsi_pio_push_handler; /* default PIO */ 1997 fsi->playback.handler = &fsi_pio_push_handler; /* default PIO */
1997 fsi->playback.priv = fsi; 1998 fsi->playback.priv = fsi;
1998 fsi->capture.handler = &fsi_pio_pop_handler; /* default PIO */ 1999 fsi->capture.handler = &fsi_pio_pop_handler; /* default PIO */
1999 fsi->capture.priv = fsi; 2000 fsi->capture.priv = fsi;
2000 2001
2001 if (fsi->info->tx_id) { 2002 if (info->tx_id) {
2002 fsi->playback.slave.shdma_slave.slave_id = fsi->info->tx_id; 2003 fsi->playback.slave.shdma_slave.slave_id = info->tx_id;
2003 fsi->playback.handler = &fsi_dma_push_handler; 2004 fsi->playback.handler = &fsi_dma_push_handler;
2004 } 2005 }
2005} 2006}
@@ -2009,11 +2010,16 @@ static int fsi_probe(struct platform_device *pdev)
2009 struct fsi_master *master; 2010 struct fsi_master *master;
2010 const struct platform_device_id *id_entry; 2011 const struct platform_device_id *id_entry;
2011 struct sh_fsi_platform_info *info = pdev->dev.platform_data; 2012 struct sh_fsi_platform_info *info = pdev->dev.platform_data;
2013 struct sh_fsi_port_info nul_info, *pinfo;
2012 struct fsi_priv *fsi; 2014 struct fsi_priv *fsi;
2013 struct resource *res; 2015 struct resource *res;
2014 unsigned int irq; 2016 unsigned int irq;
2015 int ret; 2017 int ret;
2016 2018
2019 nul_info.flags = 0;
2020 nul_info.tx_id = 0;
2021 nul_info.rx_id = 0;
2022
2017 id_entry = pdev->id_entry; 2023 id_entry = pdev->id_entry;
2018 if (!id_entry) { 2024 if (!id_entry) {
2019 dev_err(&pdev->dev, "unknown fsi device\n"); 2025 dev_err(&pdev->dev, "unknown fsi device\n");
@@ -2046,11 +2052,12 @@ static int fsi_probe(struct platform_device *pdev)
2046 spin_lock_init(&master->lock); 2052 spin_lock_init(&master->lock);
2047 2053
2048 /* FSI A setting */ 2054 /* FSI A setting */
2055 pinfo = (info) ? &info->port_a : &nul_info;
2049 fsi = &master->fsia; 2056 fsi = &master->fsia;
2050 fsi->base = master->base; 2057 fsi->base = master->base;
2051 fsi->master = master; 2058 fsi->master = master;
2052 fsi->info = &info->port_a; 2059 fsi->info = pinfo;
2053 fsi_handler_init(fsi); 2060 fsi_handler_init(fsi, pinfo);
2054 ret = fsi_stream_probe(fsi, &pdev->dev); 2061 ret = fsi_stream_probe(fsi, &pdev->dev);
2055 if (ret < 0) { 2062 if (ret < 0) {
2056 dev_err(&pdev->dev, "FSIA stream probe failed\n"); 2063 dev_err(&pdev->dev, "FSIA stream probe failed\n");
@@ -2058,11 +2065,12 @@ static int fsi_probe(struct platform_device *pdev)
2058 } 2065 }
2059 2066
2060 /* FSI B setting */ 2067 /* FSI B setting */
2068 pinfo = (info) ? &info->port_b : &nul_info;
2061 fsi = &master->fsib; 2069 fsi = &master->fsib;
2062 fsi->base = master->base + 0x40; 2070 fsi->base = master->base + 0x40;
2063 fsi->master = master; 2071 fsi->master = master;
2064 fsi->info = &info->port_b; 2072 fsi->info = pinfo;
2065 fsi_handler_init(fsi); 2073 fsi_handler_init(fsi, pinfo);
2066 ret = fsi_stream_probe(fsi, &pdev->dev); 2074 ret = fsi_stream_probe(fsi, &pdev->dev);
2067 if (ret < 0) { 2075 if (ret < 0) {
2068 dev_err(&pdev->dev, "FSIB stream probe failed\n"); 2076 dev_err(&pdev->dev, "FSIB stream probe failed\n");