summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2012-11-16 01:16:52 -0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-11-20 15:11:21 +0900
commit943fdadc17962b7ca6fa28167d1077b383dead4b (patch)
treedb556acf32eee2b9683e3b1da2802566d2a12fad /sound/soc/sh
parent40f9118bd140ce949a38c1a8cbd6105c38e90478 (diff)
downloadop-kernel-dev-943fdadc17962b7ca6fa28167d1077b383dead4b.zip
op-kernel-dev-943fdadc17962b7ca6fa28167d1077b383dead4b.tar.gz
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 913916a..3260d54 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 = {
/*
* platform function
*/
-static void fsi_handler_init(struct fsi_priv *fsi)
+static void fsi_handler_init(struct fsi_priv *fsi,
+ struct sh_fsi_port_info *info)
{
fsi->playback.handler = &fsi_pio_push_handler; /* default PIO */
fsi->playback.priv = fsi;
fsi->capture.handler = &fsi_pio_pop_handler; /* default PIO */
fsi->capture.priv = fsi;
- if (fsi->info->tx_id) {
- fsi->playback.slave.shdma_slave.slave_id = fsi->info->tx_id;
+ if (info->tx_id) {
+ fsi->playback.slave.shdma_slave.slave_id = info->tx_id;
fsi->playback.handler = &fsi_dma_push_handler;
}
}
@@ -2009,11 +2010,16 @@ static int fsi_probe(struct platform_device *pdev)
struct fsi_master *master;
const struct platform_device_id *id_entry;
struct sh_fsi_platform_info *info = pdev->dev.platform_data;
+ struct sh_fsi_port_info nul_info, *pinfo;
struct fsi_priv *fsi;
struct resource *res;
unsigned int irq;
int ret;
+ nul_info.flags = 0;
+ nul_info.tx_id = 0;
+ nul_info.rx_id = 0;
+
id_entry = pdev->id_entry;
if (!id_entry) {
dev_err(&pdev->dev, "unknown fsi device\n");
@@ -2046,11 +2052,12 @@ static int fsi_probe(struct platform_device *pdev)
spin_lock_init(&master->lock);
/* FSI A setting */
+ pinfo = (info) ? &info->port_a : &nul_info;
fsi = &master->fsia;
fsi->base = master->base;
fsi->master = master;
- fsi->info = &info->port_a;
- fsi_handler_init(fsi);
+ fsi->info = pinfo;
+ fsi_handler_init(fsi, pinfo);
ret = fsi_stream_probe(fsi, &pdev->dev);
if (ret < 0) {
dev_err(&pdev->dev, "FSIA stream probe failed\n");
@@ -2058,11 +2065,12 @@ static int fsi_probe(struct platform_device *pdev)
}
/* FSI B setting */
+ pinfo = (info) ? &info->port_b : &nul_info;
fsi = &master->fsib;
fsi->base = master->base + 0x40;
fsi->master = master;
- fsi->info = &info->port_b;
- fsi_handler_init(fsi);
+ fsi->info = pinfo;
+ fsi_handler_init(fsi, pinfo);
ret = fsi_stream_probe(fsi, &pdev->dev);
if (ret < 0) {
dev_err(&pdev->dev, "FSIB stream probe failed\n");
OpenPOWER on IntegriCloud