From nobody Thu Apr 2 03:25:22 2026 Received: from mail-vk1-f180.google.com (mail-vk1-f180.google.com [209.85.221.180]) (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 8F2763644D0 for ; Mon, 23 Feb 2026 11:42:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771846945; cv=none; b=AUK/R4FnvqVN1kz6bQHq6GsZfAJsQ5lOkjH+SUQIZNwFK+u0KiER1nAJboMCiy8oYPcYzIhGIOrW4xeKO0os5CxmLErueS6+nw1ciE1zZa6Daua0qiXIDJnJZEJutdGZK1cDz0MTFYe3mSB+kPUhfPoCC4v1aAKb2DGHqfLrt4U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771846945; c=relaxed/simple; bh=k+fIOi3T3WxLMidLrgWYiMQBHxd+vEDrnSIOkOtyTvw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kfTDXlqMUcnlfmoDwkSM6J5Hmq9Bv/8WweLMsvyujg5gvdGT7FDBQDMkRM+AqDwFb7ZZGJOANanbU+qianl3skUJmaBiQCQJ+XmtWiaXRy7IpFAKS82R+x/aPs3E8ObZDb97McOSEA+pBlUkqHzzUt7FNCdDlMEmVVEi1tkPCvw= 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=Z2t6EtHx; arc=none smtp.client-ip=209.85.221.180 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="Z2t6EtHx" Received: by mail-vk1-f180.google.com with SMTP id 71dfb90a1353d-56753dc51baso1982729e0c.1 for ; Mon, 23 Feb 2026 03:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771846942; x=1772451742; darn=vger.kernel.org; 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=RmmrtGlDRSEU043yEU70zvdkJUij3sS5DuLSSmJgOEk=; b=Z2t6EtHxhiO0piVexqN4iQZnwwvZB/pVaerUnDm3gjE16rPKMkiQzJXQeLdw7oWsTJ pspHB4Z03Yg/hg/RFXf2STCywYcym5Hqkops/LzNdPCvbLz/NwgDKVp05ZWeBO4Qa5hj lJfmF7/adYKM7aDIrSDVWysVTaYS0wkM3/FwMyqQAdk61pQmRwUMazQ+Pz0fr36QFL1y npnwmA9QDmWZ7kFUyKBCuNCxzsUznAt9tAFwE14i/jIjE2Qm9d1OIecd+pjMQYtjuHQF k/oiX8ZWrmVjhsUPseg+Ieu+6emz13ngKTwmAFJG2NQUlo8BasITAbjoQuc6aUmc3NME iXdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771846942; x=1772451742; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=RmmrtGlDRSEU043yEU70zvdkJUij3sS5DuLSSmJgOEk=; b=S+S14FYSiUWiJAaecrE7s4/VOTIkSjfviUmzHl8vm0Lw0oqN3SNlA7HPS2/8Y8+/Rt CxcFkcQtPqz5LBNsl0yZglipdYI/KLKS8up9zAM4fjIrt4PNc0/lUfOsjdavr9hbBlPM XZHANQyC0lmptBrk3BFZRZnJCSZOxrw4LoSkB85mBniF2X9LIByhiHl5eK1R+OtaDWS9 0IyXYoCRGoc6skt0RUGxmInaLETcfmE2IxwF1zvZcRxQo4U8/q+cfR0Q5/zIy2wT0aWW Vo3gJAlYez5Hefi06bJaFbjp5rGf/wUlZQDx/DUy4o7VoXgLIE9f6UquFGaH8YzgTMOr dFxQ== X-Forwarded-Encrypted: i=1; AJvYcCVlYkIScgbOFmJB59kTdUi4/Sp++xgznfAslhy1pawKUV3iHmWs70uEpbzbNpPHjUI3dp5JtuZFBnRt2Ps=@vger.kernel.org X-Gm-Message-State: AOJu0YxlWDKOHHJf5vEOm4PDdDeC1dVzZmZ4gGEplEpeDGVn05SG5C6A ju8VFVu4pqoZKmZ5fQrEnvuv34X919XdKk1g4Jn8BlzSWaVDhtBVUGDr X-Gm-Gg: AZuq6aJaw1Yv15Qj5CqQbtrlRb1Di9ssXgCXzDNWw2LOArf1z3vSNgj6Elc9S5WK/yD EtNhiXmZzQ4FNXxGTB0fwyzucYYDeJF17JvGG0lM6edKFylR5L40PpcxEngLEWji0MHopk5WjY+ 3eyjKxJngy7T6GEASgaxUaA3JRLU640S40/iOsambU+g/Xr2uxKXr1JozLCR5dYEYi/9mfiWskN 771TYatLaP28mGHlwHtk5uGn68BeYE5GrxnBm+Cee/HBkUqnFc9jJOkJhhG5tEle2Y/T2+izy3/ ecgEw5P2EpkyWOLtNjL0SFnN3cWAfI7oFpMWA7/g6h4nY9Mu5EFb/RnJ8Ur4Udj0UFLBHYxkvuB RXiXJk9FyX1axxmpTlPi8zEfwRrYHCByf7FTjWV3+r/uJ3vgm2AmIjAR8LfmwyoFEnBHlxMD7kn 5OaGrdXOYngRl3cDekgXpO94cPVmu90tpXeX5cy3yiC9KDb0apnI5FGaha2IcD9iGo81WvY79qC B9W X-Received: by 2002:a05:6123:62:b0:559:6d45:9a1c with SMTP id 71dfb90a1353d-568e474a781mr2991915e0c.3.1771846942518; Mon, 23 Feb 2026 03:42:22 -0800 (PST) Received: from gustavo-arch ([2804:14c:f25a:845f:5b8d:2e7c:d238:2d28]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-568e593a666sm8285024e0c.17.2026.02.23.03.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Feb 2026 03:42:22 -0800 (PST) From: Gustavo Piaz da Silva To: gregkh@linuxfoundation.org, dan.carpenter@linaro.org Cc: ovidiu.panait.oss@gmail.com, gshahrouzi@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Gustavo Piaz da Silva Subject: [PATCH v9 2/2] staging: axis-fifo: refactor device tree parsing Date: Mon, 23 Feb 2026 08:42:07 -0300 Message-ID: <20260223114207.3639-3-gustavopiazdasilva2102@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260223114207.3639-1-gustavopiazdasilva2102@gmail.com> References: <20260223114207.3639-1-gustavopiazdasilva2102@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Refactor the device tree parsing logic in axis_fifo_probe() to reduce verbosity and simplify error handling. Remove the verbose error logging and goto logic. Instead, check of_property_read_u32() return values directly and propagate error codes immediately. This aligns the driver with modern kernel standards by removing unnecessary error messages during probe. Signed-off-by: Gustavo Piaz da Silva Reviewed-by: Dan Carpenter --- Changes in v9: - Rebased on top of staging-next branch. - Added Reviewed-by tag from Dan Carpenter. =20 Changes in v8: - Reverted line wrapping changes to keep the diff focused strictly=20 on logic refactoring and avoid unrelated whitespace noise. Changes in v7: - Reverted variable name and type from 'u32 width' back to the=20 original 'unsigned int value' to minimize unnecessary diff noise. - Removed extra blank lines between function calls and error=20 checks to keep the diff as compact as possible. Changes in v6: - Removed the axis_fifo_get_u32() helper function entirely. - Removed all dev_err() calls in axis_fifo_parse_dt() as the=20 driver core already reports probe failures. - Kept the 'node' local variable to avoid checkpatch line=20 length warnings. - Fixed checkpatch style warning (missing blank line after=20 declarations). - Ensured a newline exists at the end of the file. Changes in v5: - Added missing newline at the end of axis-fifo.c. Changes in v4: - Removed extra blank lines in the commit message. - Added "rx" and "tx" prefixes to error messages (these=20 messages were later removed in v6). Changes in v3: - Split the original monolithic v2 patch into two separate=20 patches to isolate logic refactoring from type alignment. Changes in v2: - Fixed checkpatch.pl coding style issues regarding=20 indents and line formatting. Changes in v1: - Initial submission. drivers/staging/axis-fifo/axis-fifo.c | 55 +++++++++------------------ 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-f= ifo/axis-fifo.c index e54bc4c1d40f..3aa2aa870ea9 100644 --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -392,60 +392,39 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo) =20 ret =3D of_property_read_u32(node, "xlnx,axi-str-rxd-tdata-width", &value); - if (ret) { - dev_err(fifo->dt_device, "missing xlnx,axi-str-rxd-tdata-width property\= n"); - goto end; - } else if (value !=3D 32) { - dev_err(fifo->dt_device, "xlnx,axi-str-rxd-tdata-width only supports 32 = bits\n"); - ret =3D -EIO; - goto end; - } + if (ret) + return ret; + if (value !=3D 32) + return -EINVAL; =20 ret =3D of_property_read_u32(node, "xlnx,axi-str-txd-tdata-width", &value); - if (ret) { - dev_err(fifo->dt_device, "missing xlnx,axi-str-txd-tdata-width property\= n"); - goto end; - } else if (value !=3D 32) { - dev_err(fifo->dt_device, "xlnx,axi-str-txd-tdata-width only supports 32 = bits\n"); - ret =3D -EIO; - goto end; - } + if (ret) + return ret; + if (value !=3D 32) + return -EINVAL; =20 ret =3D of_property_read_u32(node, "xlnx,rx-fifo-depth", &fifo->rx_fifo_depth); - if (ret) { - dev_err(fifo->dt_device, "missing xlnx,rx-fifo-depth property\n"); - ret =3D -EIO; - goto end; - } + if (ret) + return ret; =20 ret =3D of_property_read_u32(node, "xlnx,tx-fifo-depth", &fifo->tx_fifo_depth); - if (ret) { - dev_err(fifo->dt_device, "missing xlnx,tx-fifo-depth property\n"); - ret =3D -EIO; - goto end; - } + if (ret) + return ret; =20 ret =3D of_property_read_u32(node, "xlnx,use-rx-data", &fifo->has_rx_fifo); - if (ret) { - dev_err(fifo->dt_device, "missing xlnx,use-rx-data property\n"); - ret =3D -EIO; - goto end; - } + if (ret) + return ret; =20 ret =3D of_property_read_u32(node, "xlnx,use-tx-data", &fifo->has_tx_fifo); - if (ret) { - dev_err(fifo->dt_device, "missing xlnx,use-tx-data property\n"); - ret =3D -EIO; - goto end; - } + if (ret) + return ret; =20 -end: - return ret; + return 0; } =20 static int axis_fifo_probe(struct platform_device *pdev) --=20 2.53.0