diff options
author | Subhransu S. Prusty <subhransu.s.prusty@intel.com> | 2014-07-30 09:09:05 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-31 15:18:09 -0400 |
commit | 2741d43a1edd13c81a50ceb63f4edbf5fedb53ce (patch) | |
tree | 95a69a817a7a5fa89f258b1f493891ff46cf63e0 /sound/soc/intel/sst-mfld-platform-pcm.c | |
parent | 19a23a5d76e59f84caafea7a3299c23894ecad63 (diff) |
ASoC: Intel: mfld-pcm: Allocate platform data
Platform data may be null during platform_device_add. Allocate platform
data before using.
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/intel/sst-mfld-platform-pcm.c')
-rw-r--r-- | sound/soc/intel/sst-mfld-platform-pcm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/soc/intel/sst-mfld-platform-pcm.c b/sound/soc/intel/sst-mfld-platform-pcm.c index 47df05ed3ac3..706212a6a68c 100644 --- a/sound/soc/intel/sst-mfld-platform-pcm.c +++ b/sound/soc/intel/sst-mfld-platform-pcm.c | |||
@@ -570,7 +570,7 @@ static int sst_platform_probe(struct platform_device *pdev) | |||
570 | { | 570 | { |
571 | struct sst_data *drv; | 571 | struct sst_data *drv; |
572 | int ret; | 572 | int ret; |
573 | struct sst_platform_data *pdata = pdev->dev.platform_data; | 573 | struct sst_platform_data *pdata; |
574 | 574 | ||
575 | drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); | 575 | drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL); |
576 | if (drv == NULL) { | 576 | if (drv == NULL) { |
@@ -578,6 +578,12 @@ static int sst_platform_probe(struct platform_device *pdev) | |||
578 | return -ENOMEM; | 578 | return -ENOMEM; |
579 | } | 579 | } |
580 | 580 | ||
581 | pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | ||
582 | if (pdata == NULL) { | ||
583 | pr_err("kzalloc failed for pdata\n"); | ||
584 | return -ENOMEM; | ||
585 | } | ||
586 | |||
581 | pdata->pdev_strm_map = dpcm_strm_map; | 587 | pdata->pdev_strm_map = dpcm_strm_map; |
582 | pdata->strm_map_size = ARRAY_SIZE(dpcm_strm_map); | 588 | pdata->strm_map_size = ARRAY_SIZE(dpcm_strm_map); |
583 | drv->pdata = pdata; | 589 | drv->pdata = pdata; |