Re: [PATCH net-next v4 2/8] net: xilinx: tsn: add TSN endpoint wrapper driver
From: sashiko-bot
Date: Sat Nov 14 2026 - 07:05:35 EST
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] net: xilinx: tsn: use devm_clk_bulk_get_enable() in
tsn_ip_probe()
--
commit 9fffc2486144ec3dd4b7c4d984f898729124f771
Author: Srinivas Neeli <srinivas.neeli@xxxxxxx>
net: xilinx: tsn: add TSN endpoint wrapper driver
This commit adds a platform driver for the AMD/Xilinx TSN Endpoint Ethernet
MAC IP wrapper node that enables the IP-wide clocks and populates its child
sub-nodes.
> diff --git a/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c
> new file mode 100644
> index 0000000000000..afe7609c67fb4
> --- /dev/null
> +++ b/drivers/net/ethernet/xilinx/tsn/xilinx_tsn_main.c
[ ... ]
> +static void tsn_clk_bulk_disable(void *data)
> +{
> + struct xlnx_tsn_ip *w = data;
> +
> + clk_bulk_disable_unprepare(TSN_NUM_CLOCKS, w->clks);
> +}
> +
> +static int tsn_ip_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct xlnx_tsn_ip *w;
> + int ret;
> +
> + w = devm_kzalloc(dev, sizeof(*w), GFP_KERNEL);
> + if (!w)
> + return -ENOMEM;
> +
> + for (int i = 0; i < TSN_NUM_CLOCKS; i++)
> + w->clks[i].id = tsn_clk_names[i];
> +
> + ret = devm_clk_bulk_get(dev, TSN_NUM_CLOCKS, w->clks);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to get clocks\n");
> +
> + ret = clk_bulk_prepare_enable(TSN_NUM_CLOCKS, w->clks);
> + if (ret)
> + return dev_err_probe(dev, ret, "failed to enable clocks\n");
> +
> + ret = devm_add_action_or_reset(dev, tsn_clk_bulk_disable, w);
> + if (ret)
> + return ret;
[Severity: Low]
Could tsn_ip_probe() use devm_clk_bulk_get_enable() instead of calling
devm_clk_bulk_get(), clk_bulk_prepare_enable() and
devm_add_action_or_reset() with tsn_clk_bulk_disable()?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261113-patches_v2_external-v4-0-56bb26f042a4@xxxxxxx?part=2