Skip to content

Commit

Permalink
ipq40xx: use devm for mutex_init
Browse files Browse the repository at this point in the history
Avoids having to call mutex_destroy in remove.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: openwrt#16755
Signed-off-by: Robert Marko <robimarko@gmail.com>
  • Loading branch information
neheb authored and robimarko committed Nov 2, 2024
1 parent efd1ec5 commit 57f2c72
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Signed-off-by: Robert Marko <robert.marko@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@nbd.name>
Expand Down Expand Up @@ -989,7 +989,9 @@ Signed-off-by: Robert Marko <robert.marko@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);
Expand Down

0 comments on commit 57f2c72

Please sign in to comment.