Re: [PATCH v6 2/2] staging: axis-fifo: refactor device tree parsing

From: Dan Carpenter

Date: Mon Feb 02 2026 - 14:47:21 EST


On Mon, Feb 02, 2026 at 11:20:47AM -0300, Gustavo Piaz da Silva wrote:
> static int axis_fifo_parse_dt(struct axis_fifo *fifo)
> {
> - int ret;
> - unsigned int value;
> struct device_node *node = fifo->dt_device->of_node;
> + int ret;
> + u32 width;
>
> - ret = of_property_read_u32(node, "xlnx,axi-str-rxd-tdata-width",
> - &value);

In the original commit then there were a bunch of changes and it kind of
was fine to rename "value" to "width" because you were also changing the
commit message and it was nice that the error message matched the code.
But in this patch you're just deleting error messages and changing the
goto end to a direct return.

At that point, I would prefer to see a really minimal diff. No function
renames. No changes to the line breaks.

> - if (ret) {
> - dev_err(fifo->dt_device, "missing xlnx,axi-str-rxd-tdata-width property\n");
> - goto end;
> - } else if (value != 32) {
> - dev_err(fifo->dt_device, "xlnx,axi-str-rxd-tdata-width only supports 32 bits\n");
> - ret = -EIO;
> - goto end;
> - }
> + ret = of_property_read_u32(node, "xlnx,axi-str-rxd-tdata-width", &width);
>
> + if (ret)

Delete the blank between the function call and the error checking.

[ snip ]

> - ret = of_property_read_u32(node, "xlnx,rx-fifo-depth",
> - &fifo->rx_fifo_depth);
> + ret = of_property_read_u32(node, "xlnx,rx-fifo-depth", &fifo->rx_fifo_depth);
> + if (ret)
> + return ret;

This is an example of changing the white space. It's unrelated.
Whey you were changing to use a helper then it was related, but once
we delete the helper it's not.

regards,
dan carpenter