Commit 67380533 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Mark Brown

ASoC: codecs: wcd9335: Simplify with dev_err_probe

Code can be a bit simpler with dev_err_probe().
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230417141453.919158-1-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent c341b568
...@@ -5138,20 +5138,17 @@ static int wcd9335_irq_init(struct wcd9335_codec *wcd) ...@@ -5138,20 +5138,17 @@ static int wcd9335_irq_init(struct wcd9335_codec *wcd)
* INTR2 is a subset of first interrupt sources MAD, VBAT, and SVA * INTR2 is a subset of first interrupt sources MAD, VBAT, and SVA
*/ */
wcd->intr1 = of_irq_get_byname(wcd->dev->of_node, "intr1"); wcd->intr1 = of_irq_get_byname(wcd->dev->of_node, "intr1");
if (wcd->intr1 < 0) { if (wcd->intr1 < 0)
if (wcd->intr1 != -EPROBE_DEFER) return dev_err_probe(wcd->dev, wcd->intr1,
dev_err(wcd->dev, "Unable to configure IRQ\n"); "Unable to configure IRQ\n");
return wcd->intr1;
}
ret = devm_regmap_add_irq_chip(wcd->dev, wcd->regmap, wcd->intr1, ret = devm_regmap_add_irq_chip(wcd->dev, wcd->regmap, wcd->intr1,
IRQF_TRIGGER_HIGH, 0, IRQF_TRIGGER_HIGH, 0,
&wcd9335_regmap_irq1_chip, &wcd->irq_data); &wcd9335_regmap_irq1_chip, &wcd->irq_data);
if (ret) if (ret)
dev_err(wcd->dev, "Failed to register IRQ chip: %d\n", ret); return dev_err_probe(wcd->dev, ret, "Failed to register IRQ chip\n");
return ret; return 0;
} }
static int wcd9335_slim_probe(struct slim_device *slim) static int wcd9335_slim_probe(struct slim_device *slim)
...@@ -5207,17 +5204,15 @@ static int wcd9335_slim_status(struct slim_device *sdev, ...@@ -5207,17 +5204,15 @@ static int wcd9335_slim_status(struct slim_device *sdev,
slim_get_logical_addr(wcd->slim_ifc_dev); slim_get_logical_addr(wcd->slim_ifc_dev);
wcd->regmap = regmap_init_slimbus(sdev, &wcd9335_regmap_config); wcd->regmap = regmap_init_slimbus(sdev, &wcd9335_regmap_config);
if (IS_ERR(wcd->regmap)) { if (IS_ERR(wcd->regmap))
dev_err(dev, "Failed to allocate slim register map\n"); return dev_err_probe(dev, PTR_ERR(wcd->regmap),
return PTR_ERR(wcd->regmap); "Failed to allocate slim register map\n");
}
wcd->if_regmap = regmap_init_slimbus(wcd->slim_ifc_dev, wcd->if_regmap = regmap_init_slimbus(wcd->slim_ifc_dev,
&wcd9335_ifc_regmap_config); &wcd9335_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");
}
ret = wcd9335_bring_up(wcd); ret = wcd9335_bring_up(wcd);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment