From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88E7D23ED60 for ; Mon, 6 Jul 2026 04:58:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783313882; cv=none; b=lkJTuqZad0Pin4azcsoa+bro7BsyO4sfiW9Eb1ZnMtY6TmBLwmnBAFDtKkSerU73zP+vplFDeZ7EdAvcgJPJtaTBuRzPAewir82OY5YUmgsUbSjRVoktZ+n7lB3XcIDdSuS1lTNaAy55MgWVwLO8hxJMv6RoPtfrlnS+kZxUxDQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783313882; c=relaxed/simple; bh=dPxrydN54DmQuCWo+wwO6vQ1ZmOnnyIq8oAVMCQHBtk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LIeURB6VY+n0PJuzoxgU4KWASj2/8K2G9GjrgSFAXBioEXf8HZl2XfC7wyCq917356ExtZAAGbK2JGUkpRWWLY2X/e9OjnAmpzM/2riFrikOLB7TCRF9Lku1Ouncoilo6OKmOu0EWmZJxEGSah2JstTalvJaleTDeMjdkfMmJtE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hJVQD6tz; arc=none smtp.client-ip=209.85.210.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hJVQD6tz" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-8482074a000so76469b3a.0 for ; Sun, 05 Jul 2026 21:58:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783313881; x=1783918681; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=2mBMJxZTbTfITgIir23vIIgP+P8butuXuzKkdVsRlag=; b=hJVQD6tzoRBDhEHcdvxz0hjW5KVi7RMVYr15uw1LCA0oMon9JwyxTKO6FOAK82r9rG 29Ddce1g2/YfmZpVsFu40brd6ZDMwQt4/rTqhfJrgKSzBXakEIUyY+qkk3wAVildTN/v 5JHzl4H7a8QPcjAMJhihBrpZa/AxYF1w82Tga/ovm9raK6qJE+IbG34p4gLzISTmJOXU 5yTHg5iAwqwzO8gB18maDodwcXULhXSfhZkyn4GMe2lGii5H6h+90cNLsPldDg7QlnUF Er1/ebTJJUYdCkzJ8mvQx1px1oKS1s3oBlgkU9+0UmtKM5GIiWLDunJOyM0rS8w8qpKc IwIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783313881; x=1783918681; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=2mBMJxZTbTfITgIir23vIIgP+P8butuXuzKkdVsRlag=; b=YCuhiefKqrP3YSNV/fRztlLaS0HfrRjWfZqFTjQElAvGX3PuHbKKywC23kh4cZhv6S v2rRHVLTgsWQXLJ5s5trTXEJhgZrHxuG/1UFBUUK3SlsueB92dskkP8yXxsAgxOXPFQU XSGY2VZjG7Jr+g4qJ8QfRgZqjtCTQ3A+szYsuh9a+tRVFmbDz+x7Rvj8vSdDeCp4TySJ x3vyb4pD1hlyp9oJJEkWCoeCjIbgyeVClcH1UGZN6LYq0z+GPv5uxsTgMJGF0uHd4JPX q4l0mNcnHlwM21NYYfFwzbx2bU3Brt0SGrNoddsyoZHrZilnlcXJpeoyy4tMHR5/jzH1 JJRw== X-Forwarded-Encrypted: i=1; AHgh+RpuBByaEMHIIgHhn2BQzU0bjPTv3mBEKj60XD1DvyLcNAvcObZGem5NHYoCuJsaavtLiE2hsGmfhLLO2tM=@vger.kernel.org X-Gm-Message-State: AOJu0YyC+mYtj6H0BC0G9UtSU/Wvf9t2l92NHEU681G9g5/eYw0J6X2I iZDLDWS1rXnQWkSg1GcJyzwDmhnYOToLES0tzoioLF/xh//2BMsMsHYv X-Gm-Gg: AfdE7ck9N6ejqcE/nEXtn3pldq2MAx2rgYOTfk5tSHCREQF4kqZdbzcjeakFJkgthlg LrCdgkENa27u9rYP5HYugEpWG6mX8DncWvCq9FPBc8e+9xGzvJK3/88pSsPAr9ag56UIIlunaAr ApEAeQqS1OSypa9fgc+rM4bUqkOUGIW5NyNOxqFgjRaRj5UBXvfa82jSgwtJFuAO9W+KfM1CsJF RQTuJba3FipNPBIYe8XPmaZcYhL7bJzR1FG1jmgt6IrpvmFw6A6/xGHyxH7mceWy/28C8jUOBB+ 0CxYBGR9LuwQXa2GtY7FAyGskT3odcadWwt9Y/1Rrityf20M0G5BVWdbT5tNw6qAX8iROwCHAVa 5xM2JjOwhS42G9/B40SvO2SRurUkJBtuLHZX+HRtv1LZgpS9DtPf9rNkZNGUcaEnWMRRABbzMKp 2DQHgNZvBzioR6alyLfSujnaUXOwYUzAhZZkNc2PWeiGBpiAM= X-Received: by 2002:a05:6a00:428a:b0:82d:62ed:b01d with SMTP id d2e1a72fcca58-847f6f474c0mr7369653b3a.45.1783313880851; Sun, 05 Jul 2026 21:58:00 -0700 (PDT) Received: from phuc-desktop.. ([183.91.15.56]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847f6d7c2casm2977208b3a.43.2026.07.05.21.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2026 21:58:00 -0700 (PDT) From: phucduc.bui@gmail.com To: Max Filippov , Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, bui duc phuc Subject: [PATCH] ASoC: xtensa: Use dev_err_probe() and drop redundant error handling Date: Mon, 6 Jul 2026 11:57:47 +0700 Message-ID: <20260706045747.36811-1-phucduc.bui@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: bui duc phuc Convert error paths with messages to dev_err_probe(), which combines dev_err() and the return statement while also handling -EPROBE_DEFER for the clock path. Remove the redundant "err:" label and return errors directly. Paths such as platform_get_irq() already log failures in the callee, so they simply return the error code without printing an additional message. Inline the pm_runtime_disable() cleanup at its only call site. No functional change. Signed-off-by: bui duc phuc --- sound/soc/xtensa/xtfpga-i2s.c | 60 +++++++++++++---------------------- 1 file changed, 22 insertions(+), 38 deletions(-) diff --git a/sound/soc/xtensa/xtfpga-i2s.c b/sound/soc/xtensa/xtfpga-i2s.c index 9ad86c54e3ea..c70f9103604e 100644 --- a/sound/soc/xtensa/xtfpga-i2s.c +++ b/sound/soc/xtensa/xtfpga-i2s.c @@ -533,34 +533,25 @@ static int xtfpga_i2s_probe(struct platform_device *pdev) int err, irq; i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL); - if (!i2s) { - err = -ENOMEM; - goto err; - } + if (!i2s) + return -ENOMEM; + platform_set_drvdata(pdev, i2s); i2s->dev = &pdev->dev; dev_dbg(&pdev->dev, "dev: %p, i2s: %p\n", &pdev->dev, i2s); i2s->regs = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(i2s->regs)) { - err = PTR_ERR(i2s->regs); - goto err; - } + if (IS_ERR(i2s->regs)) + return PTR_ERR(i2s->regs); i2s->regmap = devm_regmap_init_mmio(&pdev->dev, i2s->regs, &xtfpga_i2s_regmap_config); - if (IS_ERR(i2s->regmap)) { - dev_err(&pdev->dev, "regmap init failed\n"); - err = PTR_ERR(i2s->regmap); - goto err; - } + if (IS_ERR(i2s->regmap)) + dev_err_probe(&pdev->dev, PTR_ERR(i2s->regmap), "regmap init failed\n"); i2s->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(i2s->clk)) { - dev_err(&pdev->dev, "couldn't get clock\n"); - err = PTR_ERR(i2s->clk); - goto err; - } + if (IS_ERR(i2s->clk)) + dev_err_probe(&pdev->dev, PTR_ERR(i2s->clk), "couldn't get clock\n"); regmap_write(i2s->regmap, XTFPGA_I2S_CONFIG, (0x1 << XTFPGA_I2S_CONFIG_CHANNEL_BASE)); @@ -568,41 +559,34 @@ static int xtfpga_i2s_probe(struct platform_device *pdev) regmap_write(i2s->regmap, XTFPGA_I2S_INT_MASK, XTFPGA_I2S_INT_UNDERRUN); irq = platform_get_irq(pdev, 0); - if (irq < 0) { - err = irq; - goto err; - } + if (irq < 0) + return irq; + err = devm_request_threaded_irq(&pdev->dev, irq, NULL, xtfpga_i2s_threaded_irq_handler, IRQF_SHARED | IRQF_ONESHOT, pdev->name, i2s); - if (err < 0) { - dev_err(&pdev->dev, "request_irq failed\n"); - goto err; - } + if (err < 0) + return err; err = devm_snd_soc_register_component(&pdev->dev, &xtfpga_i2s_component, xtfpga_i2s_dai, ARRAY_SIZE(xtfpga_i2s_dai)); - if (err < 0) { - dev_err(&pdev->dev, "couldn't register component\n"); - goto err; - } + if (err < 0) + return err; + pm_runtime_enable(&pdev->dev); if (!pm_runtime_enabled(&pdev->dev)) { err = xtfpga_i2s_runtime_resume(&pdev->dev); - if (err) - goto err_pm_disable; + if (err) { + pm_runtime_disable(&pdev->dev); + return err; + } } - return 0; -err_pm_disable: - pm_runtime_disable(&pdev->dev); -err: - dev_err(&pdev->dev, "%s: err = %d\n", __func__, err); - return err; + return 0; } static void xtfpga_i2s_remove(struct platform_device *pdev) -- 2.43.0