[openwrt/openwrt] ipq40xx: use devm for mutex_init

LEDE Commits lede-commits at lists.infradead.org
Thu Nov 28 10:57:08 PST 2024


ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-24.10:
https://git.openwrt.org/fbe50c67c615a2df77072586fc4a5c2144bb9597

commit fbe50c67c615a2df77072586fc4a5c2144bb9597
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Oct 18 18:56:30 2024 -0700

    ipq40xx: use devm for mutex_init
    
    Avoids having to call mutex_destroy in remove.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/16755
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    (cherry picked from commit 57f2c72505f24b41fd9beaef3a8aa713b436cdb9)
    Link: https://github.com/openwrt/openwrt/pull/17097
    Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 .../706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch b/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch
index 20dd345c69..9bd5ca515e 100644
--- a/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch
+++ b/target/linux/ipq40xx/patches-6.6/706-net-dsa-qca8k-add-IPQ4019-built-in-switch-support.patch
@@ -87,7 +87,7 @@ Signed-off-by: Robert Marko <robert.marko at sartura.hr>
  		if (!dsa_port_offloads_bridge(dsa_to_port(ds, i), &bridge))
 --- /dev/null
 +++ b/drivers/net/dsa/qca/qca8k-ipq4019.c
-@@ -0,0 +1,946 @@
+@@ -0,0 +1,948 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2009 Felix Fietkau <nbd at nbd.name>
@@ -989,7 +989,9 @@ Signed-off-by: Robert Marko <robert.marko at sartura.hr>
 +	priv->ds->num_ports = QCA8K_IPQ4019_NUM_PORTS;
 +	priv->ds->priv = priv;
 +	priv->ds->ops = &qca8k_ipq4019_switch_ops;
-+	mutex_init(&priv->reg_mutex);
++	ret = devm_mutex_init(dev, &priv->reg_mutex);
++	if (ret)
++		return ret;
 +	platform_set_drvdata(pdev, priv);
 +
 +	return dsa_register_switch(priv->ds);




More information about the lede-commits mailing list