From patchwork Mon Apr 17 14:14:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 674552 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 4B6AEC77B70 for ; Mon, 17 Apr 2023 14:16:27 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 07BFFBC0; Mon, 17 Apr 2023 16:15:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 07BFFBC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681740985; bh=tYI9XY6ZSj8vDuP9ew3r8r85M7hkzrlK6IHH8D+MwSw=; h=From:To:Subject:Date:CC:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=VvV4kK8NOSAC55y9Si3A0Ovayya3X9H8l/8GkXNIbdlq1NXNP7zeQ7oujD6E6iLLL Q/0KzXRXhI5WdCi68iaEjHpBKFmbQrINvBP1cUkWMA/KQkIxi733Inc5XFQsueJKX+ IZ3hxo3IwuYjdTWE+eXwLDDeODpkPPcfQ9OdeR6E= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 40275F8049C; Mon, 17 Apr 2023 16:15:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 47EE6F804F2; Mon, 17 Apr 2023 16:15:04 +0200 (CEST) Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1B333F80212 for ; Mon, 17 Apr 2023 16:14:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1B333F80212 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=w/93HIzA Received: by mail-ej1-x62e.google.com with SMTP id u3so12521450ejj.12 for ; Mon, 17 Apr 2023 07:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681740896; x=1684332896; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=l8OjZCSSC//phSuWYvfawiHJ89Dsp2AaxdfcVlgHVfA=; b=w/93HIzAuP5t6l+IMz0tDo3YXGzXWUJfwpErdrbZ2jkDH3nOltQcKZOYn6MZ1Ylvl1 YLolZ3KjnWSSIntWx1g4yDPgdjiqT6I2zzmCX5KJQaQXaq7L1KeNKa/3w2mWAegaasjt GWU8XrzdE0Pru49Zd1WhwPo+2oynrKKVG5jGGjYX7k30SB0aWL2mm0mc/6absdit0rpU BBAP1E3hWtowRNEii0j1CYtHHW29bvRE0778vJ/k0HYCuNJqW5M39iKouODl141uyHqW 6pLzU7eyxgPEr7q/m3ltm80htp1o9qRxVwIM7gIQTCZ35T61WGr6juhm5kInRcEn1L7g Lr1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681740896; x=1684332896; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l8OjZCSSC//phSuWYvfawiHJ89Dsp2AaxdfcVlgHVfA=; b=hFDrFXK+e9QeCp3uSa7hF1k6j5fiapRDTt8HG30GKyz8Krqx7zUntIDDsADVOzOaDT 4MhIejmXME6QY/Jg15vmWVeMqTupqDEYeNQJs+AIPwORS1Yhwf+3n11wf2ce+xxoSk1i imeEtmX7b8Ti+JuLoTPTkqovL5vIofFXuW5dEee8OvOsm7Z4PBT4xPG2nBgOGqmEwJfa 5NC9XPUtud7m7FO1D8ikbe7iv9iLWOuItrD0DL030ozPmco2XlSAHjjBfoetTHimnx4x Iko0XicPy7evk3pNhxe28sBcSJYt6bT0R4BDo00OggN+oAR0SJuZjoBFuoji80MjPHrV rE3Q== X-Gm-Message-State: AAQBX9cVe0V1CifHlYWC+h8kA3JVgVQu5oQiS1c7CZVPsLi8fW7ye5ot RHLfWcxU4iKjBCZbqkCli87usA== X-Google-Smtp-Source: AKy350a2bmRei9A0qs2pgDzWdwVvj/XCBSxX7OL18aPrP8Z+ZGBhJJ5K8guxgj+yHghapBSOeIWGQg== X-Received: by 2002:a17:907:7e9c:b0:94f:335b:4da0 with SMTP id qb28-20020a1709077e9c00b0094f335b4da0mr6563124ejc.51.1681740895939; Mon, 17 Apr 2023 07:14:55 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:96aa:60eb:e021:6511]) by smtp.gmail.com with ESMTPSA id q6-20020a056402040600b004f9e6495f94sm5832034edv.50.2023.04.17.07.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 07:14:55 -0700 (PDT) From: Krzysztof Kozlowski To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] ASoC: codecs: wcd9335: Simplify with dev_err_probe Date: Mon, 17 Apr 2023 16:14:50 +0200 Message-Id: <20230417141453.919158-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Message-ID-Hash: OZFHZG7MPDUJNZNDU44VK3T2UDMOYP6H X-Message-ID-Hash: OZFHZG7MPDUJNZNDU44VK3T2UDMOYP6H X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Code can be a bit simpler with dev_err_probe(). Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wcd9335.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c index d2548fdf9ae5..8bf3510a3ea3 100644 --- a/sound/soc/codecs/wcd9335.c +++ b/sound/soc/codecs/wcd9335.c @@ -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 */ wcd->intr1 = of_irq_get_byname(wcd->dev->of_node, "intr1"); - if (wcd->intr1 < 0) { - if (wcd->intr1 != -EPROBE_DEFER) - dev_err(wcd->dev, "Unable to configure IRQ\n"); - - return wcd->intr1; - } + if (wcd->intr1 < 0) + return dev_err_probe(wcd->dev, wcd->intr1, + "Unable to configure IRQ\n"); ret = devm_regmap_add_irq_chip(wcd->dev, wcd->regmap, wcd->intr1, IRQF_TRIGGER_HIGH, 0, &wcd9335_regmap_irq1_chip, &wcd->irq_data); 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) @@ -5207,17 +5204,15 @@ static int wcd9335_slim_status(struct slim_device *sdev, slim_get_logical_addr(wcd->slim_ifc_dev); wcd->regmap = regmap_init_slimbus(sdev, &wcd9335_regmap_config); - if (IS_ERR(wcd->regmap)) { - dev_err(dev, "Failed to allocate slim register map\n"); - return PTR_ERR(wcd->regmap); - } + if (IS_ERR(wcd->regmap)) + return dev_err_probe(dev, PTR_ERR(wcd->regmap), + "Failed to allocate slim register map\n"); wcd->if_regmap = regmap_init_slimbus(wcd->slim_ifc_dev, &wcd9335_ifc_regmap_config); - if (IS_ERR(wcd->if_regmap)) { - dev_err(dev, "Failed to allocate ifc register map\n"); - return PTR_ERR(wcd->if_regmap); - } + if (IS_ERR(wcd->if_regmap)) + return dev_err_probe(dev, PTR_ERR(wcd->if_regmap), + "Failed to allocate ifc register map\n"); ret = wcd9335_bring_up(wcd); if (ret) { From patchwork Mon Apr 17 14:14:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 673849 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 8B90BC77B76 for ; Mon, 17 Apr 2023 14:17:23 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 26672A4C; Mon, 17 Apr 2023 16:16:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 26672A4C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681741041; bh=Ka4LVzUhoMFE3p8/rmvKZeBMoeQATjlJQ/Lo5zaeFQM=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VA3RdokgVNZxXtzoEGEl09iGgbyVBzMYQMvKupaUrWlGq70cj0esqOf4tN1SQAh9Q UwXlg2Uobmcznfu93/9BOi9+VE60xTFQKS1keH5oqCtyReyyEv9cgUZirRtTNI5PA2 YRLWx9loVogwrqzGnAs3CtkmjTuWUHy621Yc0HgM= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C2719F8023A; Mon, 17 Apr 2023 16:16:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AF76EF80269; Mon, 17 Apr 2023 16:16:26 +0200 (CEST) Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 614CEF8023A for ; Mon, 17 Apr 2023 16:14:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 614CEF8023A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=RzE+hWQv Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-504eb1155d3so20347974a12.1 for ; Mon, 17 Apr 2023 07:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681740897; x=1684332897; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DdSLfFTkv6LYV3M0mzyuGaPRuWS7s/5vp6QK5VHSwvw=; b=RzE+hWQvLG+ToUxcaDtEz9Q3e8NAYpfR7V5FIpzDQuomR5owNFdDhUvH2QaJipF10D GWjQqAHBtrZGC615Ls7NgtT+6C4C1jOjVw0B7hMOEY3u/fUyHuT3t4TsOAkAKWsVI1h4 AEfglOWetOIog4xZls6MOZJkql6492Ni2Zw4EoF5Qo+zrz5dJPENj1jeJIRTF9U1khZ6 fn936x3xvUrAzwgWBXafJCWCBWUufiAkTrw9X8JlPtynRTseumDspzinwkfJVPxg/qgG ZZ4hsxxTHKzvHpblKwulKigeP7Nw7tZNwiWpKpZlNnxIC1QrXUS+vvo4QSm+yRiHh8Qc zanA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681740897; x=1684332897; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DdSLfFTkv6LYV3M0mzyuGaPRuWS7s/5vp6QK5VHSwvw=; b=VzQBDZRIgxYXlfXR6LXCmdx5T4eyTKepn78FNTVnraS+8hcGHdCV6UKmhFgklCFtZE LPlBpffyRZ75MCxAw2kAI1puomm+KSQw9BCFoO1+6N10OK6bp0tZJ+cBCRqL9LTS3SNS mQHCpY0wRsOb3ED59GRxIzGDNx1iBt3wH5gKad2DJJWrYjIuSt+IBNBAy/xs1mY7G3Bl q4hHh7whOsQYJ7KF1It15LctlO0mogRDLbzE0CAJqWHJwKyHYIynUfFaTkNG7hhmRNiK 1iX5wpqz/5Fw/AcqIQ/jRFSYi3VjM4xAndUPzffafsQV4p0aBiyJ3C5+o478BG49omyO DQjA== X-Gm-Message-State: AAQBX9cekzKn26rgzCgmHeVcx97csALiPPj+kvttdGKN/2pM4/qzg1cA iOQCdZ90PJpSG3xNb1jC2Q7tng== X-Google-Smtp-Source: AKy350ZpK+Q0Lk/sUrpuzdbTEMJgrM0zQiaQj9MfhnmQ30N0Ripjw7eud+5jh+xVfNdGhumzqyNY+Q== X-Received: by 2002:a05:6402:4cb:b0:504:9350:f458 with SMTP id n11-20020a05640204cb00b005049350f458mr13585489edw.1.1681740897195; Mon, 17 Apr 2023 07:14:57 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:96aa:60eb:e021:6511]) by smtp.gmail.com with ESMTPSA id q6-20020a056402040600b004f9e6495f94sm5832034edv.50.2023.04.17.07.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 07:14:56 -0700 (PDT) From: Krzysztof Kozlowski To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] ASoC: codecs: wcd934x: Simplify with dev_err_probe Date: Mon, 17 Apr 2023 16:14:51 +0200 Message-Id: <20230417141453.919158-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417141453.919158-1-krzysztof.kozlowski@linaro.org> References: <20230417141453.919158-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: BWSG3TVJRA6WJJQH4HEWJPGVLEX6NPEW X-Message-ID-Hash: BWSG3TVJRA6WJJQH4HEWJPGVLEX6NPEW X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Code can be a bit simpler with dev_err_probe(). Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wcd934x.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c index 783479a4d535..56487ad2f048 100644 --- a/sound/soc/codecs/wcd934x.c +++ b/sound/soc/codecs/wcd934x.c @@ -5868,10 +5868,9 @@ static int wcd934x_codec_parse_data(struct wcd934x_codec *wcd) slim_get_logical_addr(wcd->sidev); wcd->if_regmap = regmap_init_slimbus(wcd->sidev, &wcd934x_ifc_regmap_config); - if (IS_ERR(wcd->if_regmap)) { - dev_err(dev, "Failed to allocate ifc register map\n"); - return PTR_ERR(wcd->if_regmap); - } + if (IS_ERR(wcd->if_regmap)) + return dev_err_probe(dev, PTR_ERR(wcd->if_regmap), + "Failed to allocate ifc register map\n"); of_property_read_u32(dev->parent->of_node, "qcom,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)); irq = regmap_irq_get_virq(data->irq_data, WCD934X_IRQ_SLIMBUS); - if (irq < 0) { - dev_err(wcd->dev, "Failed to get SLIM IRQ\n"); - return irq; - } + if (irq < 0) + return dev_err_probe(wcd->dev, irq, "Failed to get SLIM IRQ\n"); ret = devm_request_threaded_irq(dev, irq, NULL, wcd934x_slim_irq_handler, IRQF_TRIGGER_RISING | IRQF_ONESHOT, "slim", wcd); - if (ret) { - dev_err(dev, "Failed to request slimbus irq\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to request slimbus irq\n"); wcd934x_register_mclk_output(wcd); platform_set_drvdata(pdev, wcd); From patchwork Mon Apr 17 14:14:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 673850 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 EA744C77B76 for ; Mon, 17 Apr 2023 14:16:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 78B15DF3; Mon, 17 Apr 2023 16:16:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 78B15DF3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681741010; bh=ft0SiYRyQvLooirrWYeXmQFGpIOdf5+zsXqG908/Fe0=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qSgYPPpvsxEyJcPF++FjTMMJ3kB8IbhSxqfgw1hCid5j4q3Dszt/RZn0glkTlyXth JYXHLF1FfPq7c49LO84qM1KEgwhyG16PR6xSilKOsz0jIZC4dkWiZdCTfc1emCVpu8 PP0W3AQnd7i03vtZRB7OTBhNfzman8nXu/nGTjy0= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id CD888F80529; Mon, 17 Apr 2023 16:15:11 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2F0D7F8049C; Mon, 17 Apr 2023 16:15:08 +0200 (CEST) Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 957E6F8025D for ; Mon, 17 Apr 2023 16:15:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 957E6F8025D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=YATFDIf1 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5067736607fso3080458a12.0 for ; Mon, 17 Apr 2023 07:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681740899; x=1684332899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QQmIdP3RJKa4pxnl8xRRCwok/HaLYslpm8yDZiO67M8=; b=YATFDIf1tAx0aaKR/kVjChTDSUWOUhhDgFiTENafwW1rgezl7ILWfZWDw7oLDEc87Z WAeF8koTDqiRrZERt0r5ffbpmiST9jLq98jNACPzcNl8xc9i1n6uTg9yHpYkniMzqqOb aD+QzPlJ8NBVDHP02Frk2E6BEEKg2xV+qMvhMbWghNmVHZyfRwU4g23CMLjuDATcepUT oOLNzDjPSi0ISjl6KGii894jUlFkCB/i10NRV2OYEUh90uc7zKQb+cGedzuwuJ9ExXrj dlFdJzyayYN8rsX0TE55PsClsyyjgAHlMZx98V9EM2F2IC6D4G5Su4RsT0QStuq0wxfI WGgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681740899; x=1684332899; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QQmIdP3RJKa4pxnl8xRRCwok/HaLYslpm8yDZiO67M8=; b=KkU0REG++ku3pppKtnouub6XYQHDPQkjpALToGibg0jUX0lO3RHGPrWTHRVxbJ2LfH EQ3mriCnSSFESXh4qdxCI/DoSpedcc95SYsduwhgO2/795aKXhMopc/mRSOmlB1yjpCD Y0WSGXGTCYkKipu73Semu51zshB1oeaPNQpGv0yEhSJzUOnFXSpSRmdxowAA5n//k/C3 piilbrk11BBV24clm72EsuVTb5RCJYYM9TtUW/leEeo2OYo0xHrPAE3Wgv4Be0GpGqrz YXM8jsOhagya2WdNy9P0vGO+n511h9LflsqXjQGeZvpy3Pg9ubZejTQvYSQUj1kjJWho MLmw== X-Gm-Message-State: AAQBX9fAUWBjKZi9dZFu+T0lwEniR1rfC7IRxsv+s1YQTu1ccMYhB4+M KAgIaGh1tm5EY6fNJ1lIHf5WVw== X-Google-Smtp-Source: AKy350bRPznj0J6IQHjCFui2MZsj2ItlqRKRcsBx6mlmVaNEguH3nVSNRhQE5soAROe85/63hO39ow== X-Received: by 2002:aa7:c90b:0:b0:506:7385:9653 with SMTP id b11-20020aa7c90b000000b0050673859653mr13444306edt.39.1681740898824; Mon, 17 Apr 2023 07:14:58 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:96aa:60eb:e021:6511]) by smtp.gmail.com with ESMTPSA id q6-20020a056402040600b004f9e6495f94sm5832034edv.50.2023.04.17.07.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 07:14:58 -0700 (PDT) From: Krzysztof Kozlowski To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] ASoC: codecs: wcd934x: Simplify &pdev->dev in probe Date: Mon, 17 Apr 2023 16:14:52 +0200 Message-Id: <20230417141453.919158-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417141453.919158-1-krzysztof.kozlowski@linaro.org> References: <20230417141453.919158-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: PHGS5CWLL66NIQZGLBWSXUO6FEQVANQT X-Message-ID-Hash: PHGS5CWLL66NIQZGLBWSXUO6FEQVANQT X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The probe already stores pointer to &pdev->dev, so use it to make the code a bit easier to read. Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wcd934x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c index 56487ad2f048..c0d1fa36d841 100644 --- a/sound/soc/codecs/wcd934x.c +++ b/sound/soc/codecs/wcd934x.c @@ -5892,12 +5892,12 @@ static int wcd934x_codec_parse_data(struct wcd934x_codec *wcd) static int wcd934x_codec_probe(struct platform_device *pdev) { - struct wcd934x_ddata *data = dev_get_drvdata(pdev->dev.parent); - struct wcd934x_codec *wcd; struct device *dev = &pdev->dev; + struct wcd934x_ddata *data = dev_get_drvdata(dev->parent); + struct wcd934x_codec *wcd; int ret, irq; - wcd = devm_kzalloc(&pdev->dev, sizeof(*wcd), GFP_KERNEL); + wcd = devm_kzalloc(dev, sizeof(*wcd), GFP_KERNEL); if (!wcd) return -ENOMEM; From patchwork Mon Apr 17 14:14:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 674551 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 DABCFC77B77 for ; Mon, 17 Apr 2023 14:16:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 56A92E0F; Mon, 17 Apr 2023 16:16:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 56A92E0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1681741017; bh=oS6pyzH9OeeJ1yhGlB+srxJpmWqxcw2IuQixGOm9Rkk=; h=From:To:Subject:Date:In-Reply-To:References:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=oZ6tWHg0jl7t5d2T8vlAoHssm9/m3TiojWje13TdqINfJRyMOWpDBZaqLx5u2g4DI mPQtiToijYeYntG79C1yGHhCAr35amIP6iB6wRlgc+ZEpTCN26NX1TELoWf4hxlwHa J8qzDdnkiJk2cXg1rV6VsIJytMYh5/AqQ1OYatiU= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 4A642F80533; Mon, 17 Apr 2023 16:15:16 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 10F5BF80533; Mon, 17 Apr 2023 16:15:12 +0200 (CEST) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 508A6F80266 for ; Mon, 17 Apr 2023 16:15:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 508A6F80266 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=NhvozIn9 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-506b2a08877so191452a12.2 for ; Mon, 17 Apr 2023 07:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681740900; x=1684332900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p+Gqwd50O978CgcnfFnllVcskvaI5UoRb9w8Mjh4Qt4=; b=NhvozIn9uNmaKOvuqJ4W3H9KLBsRVfD3pBTemHy3QP44mHjFSwo3ili22DRVQ4xWD2 OENCn9eEIw0SMkaOA13LqHh5rbD7i+R0pxasR8Gto4yvtRxOdNYS7CT9T+lpWTPEMvxY 5vZG9kd5Y3MhRasLTy+paVpBOWBMGe5Pf3CfaRG+XzYCvPfK+5c9FJoRbLQO7SeMJJWU VLK9DT7gjljEdPIhzFuQM8YbEIbjSUFqIumrHJ1BNFpzaQwx/uDRfN2SRMAy0u+JGZ2H D2z63Fdwi7Ef0StiEurf7clLKLKs5Yrzesf6m6AXNmVp10RwfIZh62BWxFtp70qdHlOw 6soQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681740900; x=1684332900; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p+Gqwd50O978CgcnfFnllVcskvaI5UoRb9w8Mjh4Qt4=; b=LcYDBSb14bIsggFFXD6JdWJnEvQFIRWG7iq4YD7TetIcfmxWrWCisUzlKFgrTJN+2p qonvvs6JxchDZCJN2AWrZV7ei813z6H7lgSgLSIhosVQsxeacRsfFFNTW9H9/+97tQFP Mrpxr+cHImC7XI6iSGVZPBPvmd7mJf85dIR48yhbr19faPU46NX+jRGQbSwFECULOvtg AGk0SkFSdk+YsbA6UJ7zu8TeZhxLR92EU0iQTlAQK2Q7XmFdODdpZNsyFTYJ6T9nOamC apNbRQm4mpc/0GJMc+p0lQAS8qI6aozD3vVVhMg6EQiIbSA6e+nrbLy5rtA27qnx8zdB 5K3g== X-Gm-Message-State: AAQBX9cKKqRxqUJ50wqIVNAOP6dSsaFGwACeqacYC3ZcItQY6dr0UaCO z954DNdj0xPnumGZWAfy8J0THg== X-Google-Smtp-Source: AKy350bTx5UrQe52hGZ0GfeZUicEE0hKJ0FthhddapTmbFaB6awlUd7hq072M3AacWUZkbPTwr9Zaw== X-Received: by 2002:aa7:c90b:0:b0:506:7385:9653 with SMTP id b11-20020aa7c90b000000b0050673859653mr13444365edt.39.1681740900005; Mon, 17 Apr 2023 07:15:00 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:96aa:60eb:e021:6511]) by smtp.gmail.com with ESMTPSA id q6-20020a056402040600b004f9e6495f94sm5832034edv.50.2023.04.17.07.14.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 07:14:59 -0700 (PDT) From: Krzysztof Kozlowski To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] ASoC: codecs: wcd938x: Simplify with dev_err_probe Date: Mon, 17 Apr 2023 16:14:53 +0200 Message-Id: <20230417141453.919158-4-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230417141453.919158-1-krzysztof.kozlowski@linaro.org> References: <20230417141453.919158-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: EXVSQNMUIM6SPDWLJ4BATSZ27OIC3PMT X-Message-ID-Hash: EXVSQNMUIM6SPDWLJ4BATSZ27OIC3PMT X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Krzysztof Kozlowski X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Code can be a bit simpler with dev_err_probe(). Signed-off-by: Krzysztof Kozlowski --- sound/soc/codecs/wcd938x.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index f033f79ed238..11b264a63b04 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -4235,18 +4235,15 @@ static int wcd938x_populate_dt_data(struct wcd938x_priv *wcd938x, struct device int ret; wcd938x->reset_gpio = of_get_named_gpio(dev->of_node, "reset-gpios", 0); - if (wcd938x->reset_gpio < 0) { - dev_err(dev, "Failed to get reset gpio: err = %d\n", - wcd938x->reset_gpio); - return wcd938x->reset_gpio; - } + if (wcd938x->reset_gpio < 0) + return dev_err_probe(dev, wcd938x->reset_gpio, + "Failed to get reset gpio\n"); wcd938x->us_euro_gpio = devm_gpiod_get_optional(dev, "us-euro", GPIOD_OUT_LOW); - if (IS_ERR(wcd938x->us_euro_gpio)) { - dev_err(dev, "us-euro swap Control GPIO not found\n"); - return PTR_ERR(wcd938x->us_euro_gpio); - } + if (IS_ERR(wcd938x->us_euro_gpio)) + return dev_err_probe(dev, PTR_ERR(wcd938x->us_euro_gpio), + "us-euro swap Control GPIO not found\n"); cfg->swap_gnd_mic = wcd938x_swap_gnd_mic; @@ -4256,16 +4253,12 @@ static int wcd938x_populate_dt_data(struct wcd938x_priv *wcd938x, struct device wcd938x->supplies[3].supply = "vdd-mic-bias"; ret = regulator_bulk_get(dev, WCD938X_MAX_SUPPLY, wcd938x->supplies); - if (ret) { - dev_err(dev, "Failed to get supplies: err = %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to get supplies\n"); ret = regulator_bulk_enable(WCD938X_MAX_SUPPLY, wcd938x->supplies); - if (ret) { - dev_err(dev, "Failed to enable supplies: err = %d\n", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "Failed to enable supplies\n"); wcd938x_dt_parse_micbias_info(dev, wcd938x);