]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: axis-fifo: remove get_dts_property() helper
authorOvidiu Panait <ovidiu.panait.oss@gmail.com>
Fri, 19 Sep 2025 19:53:58 +0000 (22:53 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Oct 2025 07:09:29 +0000 (09:09 +0200)
The get_dts_property() wrapper around of_property_read_u32() adds no
real value and duplicates error handling. Inline the calls directly in
axis_fifo_parse_dt() to reduce indirection and simplify the code.

Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com>
Link: https://lore.kernel.org/r/20250919195400.3180039-4-ovidiu.panait.oss@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/axis-fifo/axis-fifo.c

index 62fca919a52575e21a8571caa3b8283037bbed38..e3dec74a02a8e91be4784f61238cf8abf9264e00 100644 (file)
@@ -496,30 +496,14 @@ static void axis_fifo_debugfs_init(struct axis_fifo *fifo)
                            &axis_fifo_debugfs_regs_fops);
 }
 
-/* read named property from the device tree */
-static int get_dts_property(struct axis_fifo *fifo,
-                           char *name, unsigned int *var)
-{
-       int rc;
-
-       rc = of_property_read_u32(fifo->dt_device->of_node, name, var);
-       if (rc) {
-               dev_err(fifo->dt_device, "couldn't read IP dts property '%s'",
-                       name);
-               return rc;
-       }
-       dev_dbg(fifo->dt_device, "dts property '%s' = %u\n",
-               name, *var);
-
-       return 0;
-}
-
 static int axis_fifo_parse_dt(struct axis_fifo *fifo)
 {
        int ret;
        unsigned int value;
+       struct device_node *node = fifo->dt_device->of_node;
 
-       ret = get_dts_property(fifo, "xlnx,axi-str-rxd-tdata-width", &value);
+       ret = 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;
@@ -529,7 +513,8 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
                goto end;
        }
 
-       ret = get_dts_property(fifo, "xlnx,axi-str-txd-tdata-width", &value);
+       ret = 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;
@@ -539,30 +524,32 @@ static int axis_fifo_parse_dt(struct axis_fifo *fifo)
                goto end;
        }
 
-       ret = get_dts_property(fifo, "xlnx,rx-fifo-depth",
-                              &fifo->rx_fifo_depth);
+       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;
        }
 
-       ret = get_dts_property(fifo, "xlnx,tx-fifo-depth",
-                              &fifo->tx_fifo_depth);
+       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;
        }
 
-       ret = get_dts_property(fifo, "xlnx,use-rx-data", &fifo->has_rx_fifo);
+       ret = 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 = -EIO;
                goto end;
        }
 
-       ret = get_dts_property(fifo, "xlnx,use-tx-data", &fifo->has_tx_fifo);
+       ret = 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 = -EIO;