realtek: rtl83xx: use devm for mutex_init
authorRosen Penev <rosenp@gmail.com>
Sun, 10 Nov 2024 23:54:14 +0000 (15:54 -0800)
committerRobert Marko <robimarko@gmail.com>
Tue, 12 Nov 2024 10:19:52 +0000 (11:19 +0100)
mutex_destroy is missing in remove.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16926
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c

index 5468fc0653ef51fa5a39945b81264e1486758ebb..fe0980a1beb82a9488545000f4a8d48f6cba4350 100644 (file)
@@ -1492,7 +1492,9 @@ static int __init rtl83xx_sw_probe(struct platform_device *pdev)
        priv->ds->needs_standalone_vlan_filtering = true;
        priv->dev = dev;
 
-       mutex_init(&priv->reg_mutex);
+       err = devm_mutex_init(dev, &priv->reg_mutex);
+       if (err)
+               return err;
 
        priv->family_id = soc_info.family;
        priv->id = soc_info.id;