mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt7915: check return code of sysfs_create_link
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+5
-3
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user