mt7915: check return code of sysfs_create_link

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2021-06-18 19:20:50 +02:00
parent 63b114d843
commit 7f5ea5e2fd
+5 -3
View File
@@ -134,9 +134,11 @@ static int mt7915_thermal_init(struct mt7915_phy *phy)
cdev = thermal_cooling_device_register(wiphy_name(wiphy), phy,
&mt7915_thermal_ops);
if (!IS_ERR(cdev)) {
phy->cdev = cdev;
sysfs_create_link(&wiphy->dev.kobj, &cdev->device.kobj,
"cooling_device");
if (sysfs_create_link(&wiphy->dev.kobj, &cdev->device.kobj,
"cooling_device") < 0)
thermal_cooling_device_unregister(cdev);
else
phy->cdev = cdev;
}
if (!IS_REACHABLE(CONFIG_HWMON))