diff options
| author | Ovidiu Panait <ovidiu.panait.oss@gmail.com> | 2025-09-19 22:53:58 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-10-13 09:09:29 +0200 |
| commit | 4497288513350d19e75232d0a8161f0094ade026 (patch) | |
| tree | 44be9c91a0c74954e000a6594bb7ded9240026e8 | |
| parent | b10f6768d5ce85c75b298755ba74b470f33d9bd1 (diff) | |
| download | linux-next-4497288513350d19e75232d0a8161f0094ade026.tar.gz linux-next-4497288513350d19e75232d0a8161f0094ade026.zip | |
staging: axis-fifo: remove get_dts_property() helper
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>
| -rw-r--r-- | drivers/staging/axis-fifo/axis-fifo.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c index 62fca919a525..e3dec74a02a8 100644 --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -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; |
