From patchwork Sun May 19 08:17:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Weber X-Patchwork-Id: 13667817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA9E4C25B79 for ; Sun, 19 May 2024 08:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=r0Vy7rj+TEgTBsLt8Nrgmv+Mj3phSpBTtIhIQd6ejTs=; b=0YpaaI5AAiv7ar XX8UFdIRiu2i91IRMfUaOp7s4sEFWpN7cvMvVIHDX2VsYDYxgqRDecphmU/WQFftSX/4ialLyr2Hl eVKKMi095fHiCuafbgoaK8tQ7bB6BsYXrirU76KpWtsjJmGzRzM7Yw43dYxX/SNA8kZbN5f2+xklq p8tyYmTuVNkPoyhcjJcGM+wxWCxSwI0JsCFUqNHhxdStyYnbc3pA9BcwWRHmhn/HX+wp/XYBKt3/L sPDpETTHIHZGWwa7wR/aek5h0i6GXPwzSZE4QbtB5CKmBb3FiNdwDG5+BpqMG1B5YNXHHwiZbvd5l GvMzlMH0eMlyrZgYjV9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bka-0000000Bd3F-1OHX; Sun, 19 May 2024 08:18:36 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s8bkJ-0000000Bcs0-0rqG for linux-arm-kernel@lists.infradead.org; Sun, 19 May 2024 08:18:21 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2e52181c228so29545831fa.0 for ; Sun, 19 May 2024 01:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716106695; x=1716711495; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=eh0hh6ynZxtBGDzmGDI5+hS0xKp2HfOEvcy4GZsRfWo=; b=XcDiKApgpjpiSVPM5MnGS86Sj0Jxg9VslHBXymj4FIlJ6jpdHpMUf2rZQVLIR7MiXa bfwh6c7rGn5dVfQ2QTqb/JMP75l3nDXZVfBoWG1EjqVUtm0FibzHuZF6z2R7wArAfFj3 dx6JoFMTc8/RLrSvB5Vh6lVkJxqd0sFtqoRHrKSeKSJZ+FSISs4N9gi2EK62HCj/qAcn BWh6MCz8c36vIMZ3tz9ABV4c5KcEJJu2X2rexVb5FvU4iUnvVUYqH22dP9AQK7CC8Wom WcOLFM29igEUTvobP5P0d5wGy3XFqoi6qiwRitgcl8z4Yf9RxCWNgLEpVMkmj5hpTtia SmVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716106695; x=1716711495; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eh0hh6ynZxtBGDzmGDI5+hS0xKp2HfOEvcy4GZsRfWo=; b=GQHYl0DrhmSfYrBRjdzslCtGwG7uYe/qcECR8vAveZ4mc76ZBCY04OohIH2WDzVjN4 pN/SpN1w4qMyRlBxPt0B7cOxQ3w4amur9uE+LSsRKMYEnbjjeqtnoPmvGqZHyKoyKDUb 6jKKs3mQEw4WLEdpgYGupLgVcSpTbJmPuNNXmCUXs8zTidVHBH140lzI1geb8mrHYz9b CB7LpWNL9GiAsBBm7dtHqnxRHFfYkQwZGlV/8mVvXv4tUOMIlc5bFfo9iOCMtGNIzL2N kpboDu5lGpc4z0LwfuVl6BvD01tvzH4bOPoUPhD0CKYbixarHpElZtbLdXXALbQZBOON lF5w== X-Forwarded-Encrypted: i=1; AJvYcCVdsRC96aSC33A/5+OuO2JJ9Hq9VgewrlUMeJL+HKdyP/ml0WUGWlJEesp/QV8x+LhKIaP4fR5D8V1tVxuSoLg4mkQpuKTat/4IY7omoQAzT1dbohw= X-Gm-Message-State: AOJu0YzC4Zbuu0r4eh6fxMKdUz89xoBFSLUMieV3i43lotLJvm0Zb0t6 vWUK37nrgvRUIEPociu1ZyzrQTTVOpAwJwvoj7zKfQYDLIKjvaxp X-Google-Smtp-Source: AGHT+IH1S6MZdqZnOCp1XHy0DROY6BRx/iUuxG5zGDEFD1Db54zL75jJp9OmheUmNZVBtKA5DxdCVw== X-Received: by 2002:ac2:4c4e:0:b0:523:6a08:1c91 with SMTP id 2adb3069b0e04-5236a081d53mr12374237e87.26.1716106695408; Sun, 19 May 2024 01:18:15 -0700 (PDT) Received: from hex.my.domain (83.8.125.62.ipv4.supernova.orange.pl. [83.8.125.62]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5733c34e5ccsm13698518a12.95.2024.05.19.01.18.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 01:18:15 -0700 (PDT) From: Artur Weber Date: Sun, 19 May 2024 10:17:51 +0200 Subject: [PATCH v3 5/8] ASoC: samsung: midas_wm1811: Use dev_err_probe where appropriate MIME-Version: 1.0 Message-Id: <20240519-midas-wm1811-gpio-jack-v3-5-0c1736144c0e@gmail.com> References: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> In-Reply-To: <20240519-midas-wm1811-gpio-jack-v3-0-0c1736144c0e@gmail.com> To: Sylwester Nawrocki , Krzysztof Kozlowski Cc: Liam Girdwood , Mark Brown , Rob Herring , Conor Dooley , Jaroslav Kysela , Takashi Iwai , Alim Akhtar , alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Artur Weber X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1716106686; l=2433; i=aweber.kernel@gmail.com; s=20231030; h=from:subject:message-id; bh=zl7AH36vmygEV4JVzP5ZRpRVT0yrltHsi0L0sBPvpeI=; b=jKKalLVKlQAPEmhIQI2igaYxc0WtyONvcwLUzap5etYn+mJu5GSY7yIvEUJ6368P+Mmy+lX56 VqeGNgA6LPfDMjvQfhUv+tlIihN+MvC3f/eFreYYxCb0L35bl6GBcXg X-Developer-Key: i=aweber.kernel@gmail.com; a=ed25519; pk=RhDBfWbJEHqDibXbhNEBAnc9FMkyznGxX/hwfhL8bv8= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240519_011819_366164_85BF99E2 X-CRM114-Status: GOOD ( 13.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since we're already using it in the newly-added GPIO requests for jack detection, extend it to the previous checks as well. Signed-off-by: Artur Weber --- Changes in v2: - Added this commit --- sound/soc/samsung/midas_wm1811.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index ce94550ee32e..91f4be98723c 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -646,16 +646,14 @@ static int midas_probe(struct platform_device *pdev) card->dev = dev; priv->reg_mic_bias = devm_regulator_get(dev, "mic-bias"); - if (IS_ERR(priv->reg_mic_bias)) { - dev_err(dev, "Failed to get mic bias regulator\n"); - return PTR_ERR(priv->reg_mic_bias); - } + if (IS_ERR(priv->reg_mic_bias)) + return dev_err_probe(dev, PTR_ERR(priv->reg_mic_bias), + "Failed to get mic bias regulator\n"); priv->reg_submic_bias = devm_regulator_get(dev, "submic-bias"); - if (IS_ERR(priv->reg_submic_bias)) { - dev_err(dev, "Failed to get submic bias regulator\n"); - return PTR_ERR(priv->reg_submic_bias); - } + if (IS_ERR(priv->reg_submic_bias)) + return dev_err_probe(dev, PTR_ERR(priv->reg_submic_bias), + "Failed to get submic bias regulator\n"); priv->reg_headset_mic_bias = devm_regulator_get_optional(dev, "headset-mic-bias"); @@ -669,17 +667,15 @@ static int midas_probe(struct platform_device *pdev) } priv->gpio_fm_sel = devm_gpiod_get_optional(dev, "fm-sel", GPIOD_OUT_HIGH); - if (IS_ERR(priv->gpio_fm_sel)) { - dev_err(dev, "Failed to get FM selection GPIO\n"); - return PTR_ERR(priv->gpio_fm_sel); - } + if (IS_ERR(priv->gpio_fm_sel)) + return dev_err_probe(dev, PTR_ERR(priv->gpio_fm_sel), + "Failed to get FM selection GPIO\n"); priv->gpio_lineout_sel = devm_gpiod_get_optional(dev, "lineout-sel", GPIOD_OUT_HIGH); - if (IS_ERR(priv->gpio_lineout_sel)) { - dev_err(dev, "Failed to get line out selection GPIO\n"); - return PTR_ERR(priv->gpio_lineout_sel); - } + if (IS_ERR(priv->gpio_lineout_sel)) + return dev_err_probe(dev, PTR_ERR(priv->gpio_lineout_sel), + "Failed to get line out selection GPIO\n"); priv->gpio_headset_detect = devm_gpiod_get_optional(dev, "headset-detect", GPIOD_IN);