public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Gustavo Piaz da Silva <gustavopiazdasilva2102@gmail.com>
Cc: dan.carpenter@linaro.org, ovidiu.panait.oss@gmail.com,
	gshahrouzi@gmail.com, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] staging: axis-fifo: refactor device tree parsing
Date: Mon, 2 Feb 2026 14:36:37 +0100	[thread overview]
Message-ID: <2026020220-attitude-unnerve-21ff@gregkh> (raw)
In-Reply-To: <20260202122317.13821-3-gustavopiazdasilva2102@gmail.com>

On Mon, Feb 02, 2026 at 09:23:17AM -0300, Gustavo Piaz da Silva wrote:
> 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 <gustavopiazdasilva2102@gmail.com>
> 
> Changes in v4:
>  - Removed extra blank lines in the commit message.
>  - Added "rx" and "tx" prefixes to error messages to distinguish between read and write width failures.
> 
> Changes in v3:
>  - Split the original v2 patch into two separate patches.
>  drivers/staging/axis-fifo/axis-fifo.c | 77 +++++++++------------------
>  1 file changed, 25 insertions(+), 52 deletions(-)

You are missing a --- line after the signed-off-by :(

> +static int axis_fifo_parse_dt(struct axis_fifo *fifo)
> +{
> +	u32 width;
>  
> -	ret = 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 = -EIO;
> -		goto end;
> +	if (axis_fifo_get_u32(fifo, "xlnx,axi-str-rxd-tdata-width", &width) || width != 32) {
> +		dev_err(fifo->dt_device, "rx tdata-width only supports 32 bits\n");
> +		return -EIO;
>  	}
> -
> -	ret = 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 = -EIO;
> -		goto end;
> +	if (axis_fifo_get_u32(fifo, "xlnx,axi-str-txd-tdata-width", &width) || width != 32) {
> +		dev_err(fifo->dt_device, "tx tdata-width only supports 32 bits\n");

Now you have 2 errors printed out?

And really, the helper function isn't needed, just get rid of the
dev_err() lines, why would they be needed anymore?  No other driver uses
this type of error reporting that I have noticed.

Also, do you have this hardware to test this with?

thanks,

greg k-h

  parent reply	other threads:[~2026-02-02 13:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02 12:23 [PATCH v4 0/2] staging: axis-fifo: refactor and cleanup Gustavo Piaz da Silva
2026-02-02 12:23 ` [PATCH v4 1/2] staging: axis-fifo: align fifo depth types with OF API Gustavo Piaz da Silva
2026-02-02 12:23 ` [PATCH v4 2/2] staging: axis-fifo: refactor device tree parsing Gustavo Piaz da Silva
2026-02-02 12:37   ` Dan Carpenter
2026-02-02 13:36   ` Greg KH [this message]
     [not found]     ` <CABpvFwKsBqstoiyriN6Vcx4D2Mszd1w=F6YvLRHiLK=jaYZNpQ@mail.gmail.com>
2026-02-02 13:53       ` Gustavo Piaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026020220-attitude-unnerve-21ff@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dan.carpenter@linaro.org \
    --cc=gshahrouzi@gmail.com \
    --cc=gustavopiazdasilva2102@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=ovidiu.panait.oss@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox