difos/target/linux/bcm27xx/patches-6.12/950-0700-ASoC-allo-piano-dac-plus-Suppress-517-errors.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

73 lines
2.4 KiB
Diff

From 100775ba344e136f1218ed9f9594f9875f5c4597 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Thu, 12 Dec 2024 13:05:41 +0000
Subject: [PATCH] ASoC: allo-piano-dac-plus: Suppress -517 errors
Use dev_err_probe to simplify the code and suppress EPROBE_DEFER errors.
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
sound/soc/bcm/allo-piano-dac-plus.c | 37 ++++++++---------------------
1 file changed, 10 insertions(+), 27 deletions(-)
--- a/sound/soc/bcm/allo-piano-dac-plus.c
+++ b/sound/soc/bcm/allo-piano-dac-plus.c
@@ -974,48 +974,31 @@ static int snd_allo_piano_dac_probe(stru
allo_piano_2_1_codecs[0].of_node =
of_parse_phandle(pdev->dev.of_node, "audio-codec", 0);
- if (!allo_piano_2_1_codecs[0].of_node) {
- dev_err(&pdev->dev,
- "Property 'audio-codec' missing or invalid\n");
- return -EINVAL;
- }
-
allo_piano_2_1_codecs[1].of_node =
of_parse_phandle(pdev->dev.of_node, "audio-codec", 1);
- if (!allo_piano_2_1_codecs[1].of_node) {
- dev_err(&pdev->dev,
+ if (!allo_piano_2_1_codecs[0].of_node || !allo_piano_2_1_codecs[1].of_node)
+ return dev_err_probe(&pdev->dev, -EINVAL,
"Property 'audio-codec' missing or invalid\n");
- return -EINVAL;
- }
mute_gpio[0] = devm_gpiod_get_optional(&pdev->dev, "mute1",
GPIOD_OUT_LOW);
- if (IS_ERR(mute_gpio[0])) {
- ret = PTR_ERR(mute_gpio[0]);
- dev_err(&pdev->dev,
- "failed to get mute1 gpio6: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(mute_gpio[0]))
+ return dev_err_probe(&pdev->dev, PTR_ERR(mute_gpio[0]),
+ "failed to get mute1 gpio\n");
mute_gpio[1] = devm_gpiod_get_optional(&pdev->dev, "mute2",
GPIOD_OUT_LOW);
- if (IS_ERR(mute_gpio[1])) {
- ret = PTR_ERR(mute_gpio[1]);
- dev_err(&pdev->dev,
- "failed to get mute2 gpio25: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(mute_gpio[1]))
+ return dev_err_probe(&pdev->dev, PTR_ERR(mute_gpio[1]),
+ "failed to get mute2 gpio\n");
if (mute_gpio[0] && mute_gpio[1])
snd_allo_piano_dac.set_bias_level =
snd_allo_piano_set_bias_level;
ret = snd_soc_register_card(&snd_allo_piano_dac);
- if (ret < 0) {
- dev_err(&pdev->dev,
- "snd_soc_register_card() failed: %d\n", ret);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n");
if ((mute_gpio[0]) && (mute_gpio[1]))
snd_allo_piano_gpio_mute(&snd_allo_piano_dac);