hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/base/transport_class.c
....@@ -30,6 +30,10 @@
3030 #include <linux/attribute_container.h>
3131 #include <linux/transport_class.h>
3232
33
+static int transport_remove_classdev(struct attribute_container *cont,
34
+ struct device *dev,
35
+ struct device *classdev);
36
+
3337 /**
3438 * transport_class_register - register an initial transport class
3539 *
....@@ -172,10 +176,11 @@
172176 * routine is simply a trigger point used to add the device to the
173177 * system and register attributes for it.
174178 */
175
-
176
-void transport_add_device(struct device *dev)
179
+int transport_add_device(struct device *dev)
177180 {
178
- attribute_container_device_trigger(dev, transport_add_class_device);
181
+ return attribute_container_device_trigger_safe(dev,
182
+ transport_add_class_device,
183
+ transport_remove_classdev);
179184 }
180185 EXPORT_SYMBOL_GPL(transport_add_device);
181186