diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2012-12-27 22:15:08 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-01-03 07:49:54 -0500 |
commit | fd974e52dbbdb27910d40d8feea7000f26545683 (patch) | |
tree | b1c4c53fb17448d2f24e5addb0a631818ac5a57c /sound/soc/sh | |
parent | 5d0bfc5eb9f57b319d7cd6a1d5543c8287c77812 (diff) |
ASoC: fsi: don't use platform info pointer on probe()
Current FSI driver is using platform info pointer,
but it is not good design for DT support.
This patch made it not to use platform info pointer.
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.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index f14c611b38c6..ef34ef8e92ed 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c | |||
@@ -1918,16 +1918,15 @@ static int fsi_probe(struct platform_device *pdev) | |||
1918 | { | 1918 | { |
1919 | struct fsi_master *master; | 1919 | struct fsi_master *master; |
1920 | const struct platform_device_id *id_entry; | 1920 | const struct platform_device_id *id_entry; |
1921 | struct sh_fsi_platform_info *info = pdev->dev.platform_data; | 1921 | struct sh_fsi_platform_info info; |
1922 | struct sh_fsi_port_info nul_info, *pinfo; | ||
1923 | struct fsi_priv *fsi; | 1922 | struct fsi_priv *fsi; |
1924 | struct resource *res; | 1923 | struct resource *res; |
1925 | unsigned int irq; | 1924 | unsigned int irq; |
1926 | int ret; | 1925 | int ret; |
1927 | 1926 | ||
1928 | nul_info.flags = 0; | 1927 | memset(&info, 0, sizeof(info)); |
1929 | nul_info.tx_id = 0; | 1928 | if (pdev->dev.platform_data) |
1930 | nul_info.rx_id = 0; | 1929 | memcpy(&info, pdev->dev.platform_data, sizeof(info)); |
1931 | 1930 | ||
1932 | id_entry = pdev->id_entry; | 1931 | id_entry = pdev->id_entry; |
1933 | if (!id_entry) { | 1932 | if (!id_entry) { |
@@ -1961,12 +1960,11 @@ static int fsi_probe(struct platform_device *pdev) | |||
1961 | spin_lock_init(&master->lock); | 1960 | spin_lock_init(&master->lock); |
1962 | 1961 | ||
1963 | /* FSI A setting */ | 1962 | /* FSI A setting */ |
1964 | pinfo = (info) ? &info->port_a : &nul_info; | ||
1965 | fsi = &master->fsia; | 1963 | fsi = &master->fsia; |
1966 | fsi->base = master->base; | 1964 | fsi->base = master->base; |
1967 | fsi->master = master; | 1965 | fsi->master = master; |
1968 | fsi_port_info_init(fsi, pinfo); | 1966 | fsi_port_info_init(fsi, &info.port_a); |
1969 | fsi_handler_init(fsi, pinfo); | 1967 | fsi_handler_init(fsi, &info.port_a); |
1970 | ret = fsi_stream_probe(fsi, &pdev->dev); | 1968 | ret = fsi_stream_probe(fsi, &pdev->dev); |
1971 | if (ret < 0) { | 1969 | if (ret < 0) { |
1972 | dev_err(&pdev->dev, "FSIA stream probe failed\n"); | 1970 | dev_err(&pdev->dev, "FSIA stream probe failed\n"); |
@@ -1974,12 +1972,11 @@ static int fsi_probe(struct platform_device *pdev) | |||
1974 | } | 1972 | } |
1975 | 1973 | ||
1976 | /* FSI B setting */ | 1974 | /* FSI B setting */ |
1977 | pinfo = (info) ? &info->port_b : &nul_info; | ||
1978 | fsi = &master->fsib; | 1975 | fsi = &master->fsib; |
1979 | fsi->base = master->base + 0x40; | 1976 | fsi->base = master->base + 0x40; |
1980 | fsi->master = master; | 1977 | fsi->master = master; |
1981 | fsi_port_info_init(fsi, pinfo); | 1978 | fsi_port_info_init(fsi, &info.port_b); |
1982 | fsi_handler_init(fsi, pinfo); | 1979 | fsi_handler_init(fsi, &info.port_b); |
1983 | ret = fsi_stream_probe(fsi, &pdev->dev); | 1980 | ret = fsi_stream_probe(fsi, &pdev->dev); |
1984 | if (ret < 0) { | 1981 | if (ret < 0) { |
1985 | dev_err(&pdev->dev, "FSIB stream probe failed\n"); | 1982 | dev_err(&pdev->dev, "FSIB stream probe failed\n"); |