فهرست منبع

realtek: rtl83xx: use devm for mutex_init

mutex_destroy is missing in remove.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/16926
Signed-off-by: Robert Marko <[email protected]>
(cherry picked from commit 1125ed408c7f0d130b5606ab39e4dd98a41d5f0a)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <[email protected]>
Rosen Penev 1 سال پیش
والد
کامیت
655874713e
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c

+ 3 - 1
target/linux/realtek/files-6.6/drivers/net/dsa/rtl83xx/common.c

@@ -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;