ASoC: codecs: wcd934x: Simplify with dev_err_probe

Replace dev_err() in probe() path with dev_err_probe() to:
1. Make code a bit simpler and easier to read,
2. Do not print messages on deferred probe.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230418074630.8681-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Krzysztof Kozlowski 2023-04-18 09:46:28 +02:00 committed by Mark Brown
parent 3da9d149eb
commit fa92f42942
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -5868,10 +5868,9 @@ static int wcd934x_codec_parse_data(struct wcd934x_codec *wcd)
slim_get_logical_addr(wcd->sidev); slim_get_logical_addr(wcd->sidev);
wcd->if_regmap = regmap_init_slimbus(wcd->sidev, wcd->if_regmap = regmap_init_slimbus(wcd->sidev,
&wcd934x_ifc_regmap_config); &wcd934x_ifc_regmap_config);
if (IS_ERR(wcd->if_regmap)) { if (IS_ERR(wcd->if_regmap))
dev_err(dev, "Failed to allocate ifc register map\n"); return dev_err_probe(dev, PTR_ERR(wcd->if_regmap),
return PTR_ERR(wcd->if_regmap); "Failed to allocate ifc register map\n");
}
of_property_read_u32(dev->parent->of_node, "qcom,dmic-sample-rate", of_property_read_u32(dev->parent->of_node, "qcom,dmic-sample-rate",
&wcd->dmic_sample_rate); &wcd->dmic_sample_rate);
@ -5923,19 +5922,15 @@ static int wcd934x_codec_probe(struct platform_device *pdev)
memcpy(wcd->tx_chs, wcd934x_tx_chs, sizeof(wcd934x_tx_chs)); memcpy(wcd->tx_chs, wcd934x_tx_chs, sizeof(wcd934x_tx_chs));
irq = regmap_irq_get_virq(data->irq_data, WCD934X_IRQ_SLIMBUS); irq = regmap_irq_get_virq(data->irq_data, WCD934X_IRQ_SLIMBUS);
if (irq < 0) { if (irq < 0)
dev_err(wcd->dev, "Failed to get SLIM IRQ\n"); return dev_err_probe(wcd->dev, irq, "Failed to get SLIM IRQ\n");
return irq;
}
ret = devm_request_threaded_irq(dev, irq, NULL, ret = devm_request_threaded_irq(dev, irq, NULL,
wcd934x_slim_irq_handler, wcd934x_slim_irq_handler,
IRQF_TRIGGER_RISING | IRQF_ONESHOT, IRQF_TRIGGER_RISING | IRQF_ONESHOT,
"slim", wcd); "slim", wcd);
if (ret) { if (ret)
dev_err(dev, "Failed to request slimbus irq\n"); return dev_err_probe(dev, ret, "Failed to request slimbus irq\n");
return ret;
}
wcd934x_register_mclk_output(wcd); wcd934x_register_mclk_output(wcd);
platform_set_drvdata(pdev, wcd); platform_set_drvdata(pdev, wcd);