From nobody Sun Feb 8 13:45:26 2026 Received: from mail-dl1-f45.google.com (mail-dl1-f45.google.com [74.125.82.45]) (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 E080B369985 for ; Mon, 2 Feb 2026 13:34:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770039271; cv=none; b=a06Fn8AIhRsP+q7tfasvwvGQRE8UedmXroNdRpA7WgYC2EULsWxyWjATCz6aEFgHh79PQFrNb1Oenm+1rcHw9K0MjgppJjJTFsJ0u3lI2jtoc8xDa/OYTXv59nL2CnwXKfJXYGxvUxv4y/lOR1hXFgoPLanPQ0bsIew016H5Zvw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770039271; c=relaxed/simple; bh=OI5/pPI9yZxR1PrG8KwNZ4ePisy8A7ceE6vffdCvYnI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MU0Xyeb7QLnsQaJ/PP1ylNjFpRpKJYqcvrmdMwQ2PzVh9JqBoCyVMSWqm9HFe7S0gEjhsCDUWleEmBJEIMbw5h4kvr/+j+NQA1vvyonXyE4KsKUK64z8A6bsSWzPIdomg3MDOTWdNFrQ62ChymoPyCuM2woqxT9V1h4imhPT0Eg= 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=lHgoO8//; arc=none smtp.client-ip=74.125.82.45 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="lHgoO8//" Received: by mail-dl1-f45.google.com with SMTP id a92af1059eb24-1233c155a42so7304763c88.1 for ; Mon, 02 Feb 2026 05:34:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770039269; x=1770644069; 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=mD35UFX846uck2E4P3muEsZfkii5RKJyvdmXwnceCr0=; b=lHgoO8//07+LBBlivSulTcXWnW3hMa4qp1h59XzdvLqMBedY0JKrGxNiCJ24mzRMvh DoEyAf+hs2YvZy5qjFhIXllVvFKo+0rnvG7sdllpHBVjVJnea6eIH1NNfdowNbODGoRl XiJozM+ct1MvCZcPZLqfHeJnT9Wz/o8ZUEEQHOI3WCg45msmloeSjDAdyfdMQ4i2M0r3 yrFgdWDk9jK7fjawnWV0eJWtS6V3Io8L2zwmBKWtAI4u/5IkdjddHsVJgvC8eEGZzOj8 KoWHFxVYTeQA0v9liJ5vOW0+Cq2kDTrAJsbzDeeYvSMrd9cp/L43K92SOjqb1nTCDy6Q ZnHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770039269; x=1770644069; 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=mD35UFX846uck2E4P3muEsZfkii5RKJyvdmXwnceCr0=; b=o/VQqtI1WWsu2zt+Op429alv7ipYx0L3hkxwmPMVXKW5xXtA6I8px+j4gb41DVGQ0+ HWm63GlGMa7xUXWyeoB1PAOZG9ODUIW55BPGihE/hRmkkkG09bzLP584DDrrwvazQVNQ DlzQ8XBbqDUnS4RHVjmpxumJ5FvirRi2wduhbT/8p6LzC0ezwRDmFIrcdqdKp0kWZHaL GTzMMH8hxz2EYDINiou1hMCvSXz4didXwUQ3TlVM6TYMj8WN25F4y0TFVVKoJ5anIZJz 5gQE1tKKISYGjhHU0ltVXS0U0U9DMJ6+An/5CbkNcS2BK+fbDb8BEQ1N2xR4z4XT0oUw Bn/g== X-Forwarded-Encrypted: i=1; AJvYcCXKpApL5zoknmuOQ/CtgLEGboow2Zq2D5NUOdLYeDQK5cr7n3axm+rewCw5Z+BNF2sifoLaAFbd46ongtw=@vger.kernel.org X-Gm-Message-State: AOJu0YzyN7vcrI8IJ37Jn0yJwazCIpb+wgJgbwLvaz+BbA4HO910mG7J K1JmINlpNXjU1L8FAl6z2/ROp8QbB2WukdPawHRDiLyuU4cSLGqobU3z X-Gm-Gg: AZuq6aLegFRuDT2RaEhZ8jrnc7CcIJQVtGh5d9SvV2jINNPpEBdutIcp9DvOnxXxv4F hhM5Lr/Aug8jkklVsXxix60uDnxbqRyGvbSizN3xnPnLDgO0OUrw1cmaUhZP8IjsoYUU8PQhVyI yCQcQWZf2pbjIGKanmyjGgjy2iw5+JsjDsxKDvUdoJ9OgEsHP80woZVsBknVz27PK3VZhi2DQ9v w2CJNa/GLXpwtq9T7kY7zTn523HJ71oCtkTFZSY76aHjtqYn8sb8uYZ721eWvi3A6iUE6jSGNGk +oKxd2u5IT9YQF3QDYCsfYdTn/uRH2zwbuKMbMIaqzBdC1W4nyJkFxBvI+GAxLqjEooL+iR67UI SKHGNH7jCTuBUKahGJ82IEsSZ/deQ35hsshSr/2k+vTyUrT4mlSZvtVFuLPySoNwLW4YYlVdo91 PCGPuXEDsgsY8Bromk1e6/yezCPRYHVbHZ X-Received: by 2002:a05:7022:7a6:b0:123:2d38:928d with SMTP id a92af1059eb24-125c0ffcc20mr4725431c88.36.1770039268738; Mon, 02 Feb 2026 05:34:28 -0800 (PST) Received: from gustavo-arch ([2804:14c:f25a:845f:5b8d:2e7c:d238:2d28]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b7a1af8a7bsm20097282eec.34.2026.02.02.05.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Feb 2026 05:34:28 -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 v5 1/2] staging: axis-fifo: align fifo depth types with OF API Date: Mon, 2 Feb 2026 10:34:18 -0300 Message-ID: <20260202133419.20112-2-gustavopiazdasilva2102@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260202133419.20112-1-gustavopiazdasilva2102@gmail.com> References: <20260202133419.20112-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" Change has_rx_fifo and has_tx_fifo types from int to u32 in struct axis_fifo. The of_property_read_u32() function expects a u32 pointer. While the current code might work, aligning the types avoids potential mixed-type issues and clarifies the data structure. Signed-off-by: Gustavo Piaz da Silva --- drivers/staging/axis-fifo/axis-fifo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-f= ifo/axis-fifo.c index 509d620d6ce7..7bc7bf191250 100644 --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -121,8 +121,8 @@ struct axis_fifo { =20 unsigned int rx_fifo_depth; /* max words in the receive fifo */ unsigned int tx_fifo_depth; /* max words in the transmit fifo */ - int has_rx_fifo; /* whether the IP has the rx fifo enabled */ - int has_tx_fifo; /* whether the IP has the tx fifo enabled */ + u32 has_rx_fifo; /* whether the IP has the rx fifo enabled */ + u32 has_tx_fifo; /* whether the IP has the tx fifo enabled */ =20 wait_queue_head_t read_queue; /* wait queue for asynchronos read */ struct mutex read_lock; /* lock for reading */ --=20 2.52.0 From nobody Sun Feb 8 13:45:26 2026 Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174]) (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 366FD369964 for ; Mon, 2 Feb 2026 13:34:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770039273; cv=none; b=jmgL3U7vJLZ7Y7kJGrzD5uodGZK8OM2oArb7mqosXvWj0htAxU2v7S1S7XdIIuN1nHtSDKRkGor9xDBhwnolIsvUsPaZlY1H60HLkLwW9SCpehMFlt157hCTDGhUqPTZhwLhoKPOzoBfuV2gYri2XSgljOFdWVTcweWGxWJZRy0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770039273; c=relaxed/simple; bh=FqohdCnNAx4WnMf0PB7ebL9iTd7WmrgZUOv0vcX+GEQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IFNepDiapEgzODkA/AJhaUNrfbp7sn5wVQtE/jCvbcC9F2/HQhTNrJiyT1BPrt/FERz+2y5yjY2FZXPc1KhKtgvrGDf1NuU3M4E+2Oaxown6tSK7j9dXYF7M9xvmkXIpIncTe/98SpFNuEMJF7NRQ26Nelbz7aqSDWMLcLT59pg= 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=HJvs7CKP; arc=none smtp.client-ip=74.125.82.174 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="HJvs7CKP" Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-2ae2eb49b4bso8717025eec.0 for ; Mon, 02 Feb 2026 05:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770039271; x=1770644071; 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=yge6lb5ZG7qLUrOkaknUBPOnrzubHT+OI5LgZ8GcDj4=; b=HJvs7CKP4Qs6wF95BFt/qxQrwI1PL/jA5kfn7oWOYL8H97Bmm8ueeobaBxHxPQxV1H awVmH4lkFTTzQ3mKXntmfhknw9CjCS/H+kdObViD8/tJmotjYuwydjZFKQj7B1O+eqc+ eDLAhHb/yyWvgHLVxc9cHPYtcuGGO5OliC64cOi6GGt8hqIIZj+BeHtbxcxgzjmI3vqp 5yqthn+wKA7Ze8XwzfzyT7UNtjcNaKq5iKweSxfOAmrcLgXFAjuYEPfjXSSkd7rwTlED LGYVPWGtceFWheINXb+/+crsln4JaeGoIRjlZA6J0Tc+aQKXLPEg1SeKYtUDQnPgOxag hkMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770039271; x=1770644071; 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=yge6lb5ZG7qLUrOkaknUBPOnrzubHT+OI5LgZ8GcDj4=; b=jp86AWctMD//lOMIjKlfiuwLgbb/syDW6wajwlmtiv0Xp/4jMnP4gzzbOQxXpu+/Lu DsPFiB/AKNIkCSb7E4V78IAk5ZcG8XVCFLLYKZ3LqMJ3e6kAqdCr5CX4oA9mbdZbhpiq Bjk4UOtiseCX/0Oi8VnkArPfGaz0hjtV+TrDO5HZWl8D4bbnWoKjTGDhW2uls12pkYzE sOrn2Km7kjcH1uzTLciz9gnuQ5QPIKin1qSBLMSnTRWDrCdqbysNT2ievUoRE9igZTNS F6b6PodcTLjJQ5pvcZOrAP4HQBnO/o2NQ6KttTczdboi//sPxKKXgc/rdr33Or2I0dp3 rCXQ== X-Forwarded-Encrypted: i=1; AJvYcCVfvBJhfW4oAwKM9ykqdcmgD3P3yZ/Fx0F5avuRaknchUOTNa27Am3lTiW2S2q6zU/KWDGnb2qLwTnjUn0=@vger.kernel.org X-Gm-Message-State: AOJu0YzAEKRR0M2kyKYQh44w2GzWTvbCKm14iwQf25JtlfvhHaYitumL OJVocXM69UuvWUf7BRSP0HC5ra37qbfZ2LN+09WNwqa7z457/Habq9o9 X-Gm-Gg: AZuq6aIAzSHLNVmigbTw73X1g5cITJZaelCuzl2rHmECZ8sD67XhE4FRURX7kq6c4j4 nisRMgYH4ntZnly++s92hXXIxGVB+R9aRJ7jBpSq41wF0Zbb/NJxY7HIQdCGlceRs4K9SbbRX21 W+JRC3Y5OBKMvax+BjYdEpDtrTex+kA4r89wUxRta1gyw2W1G0zQnUviodCyeR0g3Ebu28HckBf b4O2CovA7yEVo9FwxUfRGeDTMK2lFhI9Wvh66CXYyGzLFjNselrI963SxwLh7R/Ka3nLYnjuHAy FPJBHZj4t9Pd7EfaTQ8dn14VaGLaJh31R/zMJNVlC4L/hgF/8RpPZYfyME2lR1q3zEjP0B8h9LV FfrR9fG2FT18H0QxMGdBypyHfVlyos/eJsBVFi3vaqYaXNinZm38y6Mwpt1r1cWQVc+WdO7rW+G GVrcFYh0hhAqiMYQh1saXiQ2Vh5DEYROw0 X-Received: by 2002:a05:7300:a494:b0:2ae:5bde:a5c5 with SMTP id 5a478bee46e88-2b7c88ea6f2mr6048802eec.30.1770039271154; Mon, 02 Feb 2026 05:34:31 -0800 (PST) Received: from gustavo-arch ([2804:14c:f25a:845f:5b8d:2e7c:d238:2d28]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b7a1af8a7bsm20097282eec.34.2026.02.02.05.34.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Feb 2026 05:34:30 -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 v5 2/2] staging: axis-fifo: refactor device tree parsing Date: Mon, 2 Feb 2026 10:34:19 -0300 Message-ID: <20260202133419.20112-3-gustavopiazdasilva2102@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260202133419.20112-1-gustavopiazdasilva2102@gmail.com> References: <20260202133419.20112-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 code duplication and improve readability. Create a helper function axis_fifo_get_u32() to handle property reading and error checking, replacing repetitive of_property_read_u32() calls. This eliminates the goto logic for error handling in the probe path and consolidates error logging. Signed-off-by: Gustavo Piaz da Silva Changes in v5: - Added missing newline at the end of the file. Changes in v4: - Removed extra blank lines in the commit message. - Added "rx" and "tx" prefixes to error messages to distinguish between re= ad and write width failures. Changes in v3: - Split the original v2 patch into two separate patches. drivers/staging/axis-fifo/axis-fifo.c | 75 +++++++++------------------ 1 file changed, 24 insertions(+), 51 deletions(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-f= ifo/axis-fifo.c index 7bc7bf191250..08717b48b1ce 100644 --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -482,68 +482,41 @@ static void axis_fifo_debugfs_init(struct axis_fifo *= fifo) &axis_fifo_debugfs_regs_fops); } =20 -static int axis_fifo_parse_dt(struct axis_fifo *fifo) +static int axis_fifo_get_u32(struct axis_fifo *fifo, const char *prop, u32= *val) { - int ret; - unsigned int value; - struct device_node *node =3D fifo->dt_device->of_node; + int ret =3D of_property_read_u32(fifo->dt_device->of_node, prop, val); =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; + dev_err(fifo->dt_device, "missing %s property\n", prop); + return ret; } + return 0; +} =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; - } +static int axis_fifo_parse_dt(struct axis_fifo *fifo) +{ + u32 width; =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 (axis_fifo_get_u32(fifo, "xlnx,axi-str-rxd-tdata-width", &width) || wi= dth !=3D 32) { + dev_err(fifo->dt_device, "rx tdata-width only supports 32 bits\n"); + return -EIO; } - - 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 (axis_fifo_get_u32(fifo, "xlnx,axi-str-txd-tdata-width", &width) || wi= dth !=3D 32) { + dev_err(fifo->dt_device, "tx tdata-width only supports 32 bits\n"); + return -EIO; } =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 (axis_fifo_get_u32(fifo, "xlnx,rx-fifo-depth", &fifo->rx_fifo_depth)) + return -EIO; + if (axis_fifo_get_u32(fifo, "xlnx,tx-fifo-depth", &fifo->tx_fifo_depth)) + return -EIO; =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 (axis_fifo_get_u32(fifo, "xlnx,use-rx-data", &fifo->has_rx_fifo)) + return -EIO; + if (axis_fifo_get_u32(fifo, "xlnx,use-tx-data", &fifo->has_tx_fifo)) + return -EIO; =20 -end: - return ret; + return 0; } =20 static int axis_fifo_probe(struct platform_device *pdev) --=20 2.52.0