Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: qcom: Modify test for DSP in LPASS driver

As the representation of the DSP in the device
tree has changed from a required subnode to an
optional phandle, modify the test for DSP
existence in the LPASS CPU DAI driver,
accordingly.

Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kenneth Westfield and committed by
Mark Brown
8ebe148b 97a33ced

+8 -27
+8 -27
sound/soc/qcom/lpass-cpu.c
··· 359 359 .cache_type = REGCACHE_FLAT, 360 360 }; 361 361 362 - static int lpass_cpu_parse_of(struct device *dev) 363 - { 364 - struct device_node *dsp_of_node; 365 - 366 - dsp_of_node = of_get_child_by_name(dev->of_node, "qcom,adsp"); 367 - if (!dsp_of_node) { 368 - dev_err(dev, "%s() error getting qcom,adsp sub-node\n", 369 - __func__); 370 - return -EINVAL; 371 - } 372 - 373 - if (of_device_is_available(dsp_of_node)) { 374 - dev_err(dev, "%s() DSP exists and holds audio resources\n", 375 - __func__); 376 - return -EBUSY; 377 - } 378 - 379 - return 0; 380 - } 381 - 382 362 static int lpass_cpu_platform_probe(struct platform_device *pdev) 383 363 { 384 364 struct lpass_data *drvdata; 365 + struct device_node *dsp_of_node; 385 366 struct resource *res; 386 367 int ret; 368 + 369 + dsp_of_node = of_parse_phandle(pdev->dev.of_node, "qcom,adsp", 0); 370 + if (dsp_of_node) { 371 + dev_err(&pdev->dev, "%s() DSP exists and holds audio resources\n", 372 + __func__); 373 + return -EBUSY; 374 + } 387 375 388 376 drvdata = devm_kzalloc(&pdev->dev, sizeof(struct lpass_data), 389 377 GFP_KERNEL); 390 378 if (!drvdata) 391 379 return -ENOMEM; 392 380 platform_set_drvdata(pdev, drvdata); 393 - 394 - ret = lpass_cpu_parse_of(&pdev->dev); 395 - if (ret) { 396 - dev_err(&pdev->dev, "%s() error getting DT node info: %d\n", 397 - __func__, ret); 398 - return ret; 399 - } 400 381 401 382 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-lpaif"); 402 383 if (!res) {